Commit graph

716 commits

Author SHA1 Message Date
Gerald Squelart
5745998021 Bug 1331770 - Rename 'MediaContentType' to 'MediaContainerType' - r=jya
MozReview-Commit-ID: F0BWai8vPyo

--HG--
rename : dom/media/MediaContentType.cpp => dom/media/MediaContainerType.cpp
rename : dom/media/MediaContentType.h => dom/media/MediaContainerType.h
extra : rebase_source : 640ada96750b4496055087e80ae3f600c9df31c9
2017-01-18 11:59:03 +11:00
Chris Pearce
5b7a58a56b Bug 1329543 - Remove IsPrimetimeKeySystem(string) from Gecko. r=gerald
MozReview-Commit-ID: LX1ywPZDHtj

--HG--
extra : rebase_source : 8f2181b426159d7f58e9452ad3b0f4ae474388b2
2017-01-09 21:51:40 +08:00
Gerald Squelart
cd181bc396 Bug 1329561 - MediaContentType is always valid - r=jya
MediaContentType can only be created through MakeMediaContentType(), which
returns a Maybe<MediaContentType>.
If the return value is Nothing, parsing failed.
Otherwise the contained MediaContentType object is guaranteed to be valid;
E.g., GetMIMEType() will always return a non-empty string.

Note that this interface will change a lot in the following bugs&patches, so
please don't worry about the 'Get' in the never-failing GetMIMEType(), it will
be gone soon!

MozReview-Commit-ID: IjGKkQ6RVd4

--HG--
extra : rebase_source : 5254af80dec0beb05da49f68c12fecc28edd725e
2016-12-01 12:56:11 +11:00
Kilik Kuo
2873d75a62 Bug 1316573 - Reset the information in EncryptionInfo to make MediaElement reusable from encrypted content to plain content. r=jya
MozReview-Commit-ID: 4OU0sb2OSzi

--HG--
extra : rebase_source : c18f76229bc2cfde79dc114ff5bc892a973a1ae2
2017-01-12 11:33:55 +08:00
Andreas Pehrson
974dfed8db Bug 1329075 - Avoid an infinite event loop spin. r=jesup
Because we add tracks to the output streams async, it's possible to switch the
mSrcStream of a media element and *then* get a notification of an added track,
when this track originated from the old mSrcStream.
If the new mSrcStream is an output stream of the media element, this would
again add a new track async, which on the next event loop spin would show up
on mSrcStream, and the loop continues.

MozReview-Commit-ID: HmKgXLYmubh

--HG--
extra : rebase_source : 242f864e79b0b2335719a07fe9ee4b8b940d85dc
2017-01-09 19:10:48 +01:00
Andreas Pehrson
4fab9749c7 Bug 1329075 - Add asserts to StreamCaptureTrackSource for sanity. r=jesup
MozReview-Commit-ID: EeSKM4JHWGv

--HG--
extra : rebase_source : dd7f923d633dc80d6c72a97eb6aa47fe51a30f43
2017-01-09 17:02:13 +01:00
Andreas Pehrson
03beb7fb5e Bug 1329075 - Fix potential null deref issues in media element track sources. r=jesup
MozReview-Commit-ID: ExUh2magc2z

--HG--
extra : rebase_source : 9377109b8b5881d3cc122bc0c1447019dce5e069
2017-01-09 17:00:43 +01:00
Andreas Pehrson
13c708b237 Bug 1329075 - Fix assertion failure in debug build. r=jesup
With the attached test case I was failing an assert in a debug build because
NotifyMediaTrackEnabled exited early due to `mReadyState == HAVE_NOTHING` but
NotifyMediaTrackDisabled didn't. The latter would fail an assert.

MozReview-Commit-ID: 7Frpj62s0Bc

--HG--
extra : rebase_source : a1dea4f2db564fe28e6eb7f7fcd9c382a46409ac
2017-01-09 16:36:00 +01:00
Gerald Squelart
5d4cad020a Bug 1320785 - Remove obsolete 'ns' from 'StorensRefPtrPassByPtr' - r=froydnj
MozReview-Commit-ID: FuhlsLVFdLi

--HG--
extra : rebase_source : c1bb8330c4ca0dbf15a68a4dbd0dfeff615163be
2017-01-09 07:55:19 +11:00
Kaku Kuo
e3f3f93c62 Bug 1299096 - Remove the event-based play() method out from nsIDOMHTMLMediaElement.idl; r=bz
MozReview-Commit-ID: 3pHsSsADPLu

--HG--
extra : rebase_source : 9e3620c4565118f0c4f016b0bbe75ec046928718
2016-12-13 16:04:45 +08:00
Cameron McCormack
babad063ff Bug 1328832 - Part 2: Rename mozFlushType to mozilla::FlushType and make it an enum class. r=bzbarsky
MozReview-Commit-ID: D3fIngSHSsl
2017-01-05 15:31:56 +08:00
ctai
dea6f82442 Bug 1325053 - Remove media attribute code and set the currentSrc attribute to urlString after type checking in HTMLMediaElement. r=jwwang
According to current WhatWG HTML spec, the checking of media attribute in SourceElement is removed. Fix the Gecko code to reflect current spec.

MozReview-Commit-ID: 43d9zL9Fvih

--HG--
extra : rebase_source : beb87387cb1d55eb42713fbb0d344c0c64a0b6da
2016-12-21 20:42:48 +08:00
ctai
3ce829affc Bug 1323369 - Make HTMLMediaElement::UnbindFromTree to follow WhatWG HTML spec. r=jwwang
W3C HTML5 spec isn't very actively maintained now. WhatWG HTML spec:
When a media element is removed from a Document, the user agent must run the following steps:
Below is the related statement in WhatWG HTML spec:
Await a stable state, allowing the task that removed the media element from the Document to continue. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with .)
 If the media element is in a document, abort these steps.
 Run the internal pause steps for the media element.

MozReview-Commit-ID: H4EgPqj2YxD

--HG--
extra : rebase_source : 2c15adaaadd955662797dcf1c5158927f16bab97
2016-12-13 15:34:14 +08:00
ctai
3a16a07779 Bug 1222980 - Dispatch |QueueLoadFromSourceTask| to main thread. And end the synchronous section and asynchronously await a stable state when the src is not set. r=jwwang.
Dispatch |QueueLoadFromSourceTask| to main thread to make sure the task will be executed later than loadstart event. And when the src get errors, we need to end the synchronous section.

MozReview-Commit-ID: EQ0jVIMnqoZ

--HG--
extra : rebase_source : 876c62669f56581e903830beddbf0ce4435366e2
2016-12-13 15:45:59 +08:00
Jean-Yves Avenard
5203c55c49 Bug 1319992: P5. Don't attempt to estimate readyState when ended. r=jwwang
Buffered range is now calculated asynchronously. It may not be up to date by the time the MDSM has entered ended mode.
There's no point estimating readyState in ended mode anyway: we know what it is...

MozReview-Commit-ID: ErGsAwBzeXI

--HG--
extra : rebase_source : db3bde99b21f5b4377ce88509979f1499b1cd677
2016-12-14 17:35:36 +11:00
Sebastian Hengst
088b219e17 Backed out changeset 48b968826893 (bug 1319992) 2016-12-19 12:38:23 +01:00
Jean-Yves Avenard
e60f4efb30 Bug 1319992: P5. Don't attempt to estimate readyState when ended. r=jwwang
Buffered range is now calculated asynchronously. It may not be up to date by the time the MDSM has entered ended mode.
There's no point estimating readyState in ended mode anyway: we know what it is...

MozReview-Commit-ID: ErGsAwBzeXI

--HG--
extra : rebase_source : 5c57cdfab9f64a20ac1f8c5c49f36918b7f4485c
2016-12-14 17:35:36 +11:00
Carsten "Tomcat" Book
8ac85b373f Backed out changeset f982627067f7 (bug 1319992) 2016-12-16 12:41:05 +01:00
Jean-Yves Avenard
d2f0d0608b Bug 1319992: P5. Don't attempt to estimate readyState when ended. r=jwwang
Buffered range is now calculated asynchronously. It may not be up to date by the time the MDSM has entered ended mode.
There's no point estimating readyState in ended mode anyway: we know what it is...

MozReview-Commit-ID: ErGsAwBzeXI

--HG--
extra : rebase_source : bd8cecca96e93114e970e09faf09a80f56bf4c98
2016-12-14 17:35:36 +11:00
Carsten "Tomcat" Book
ed17e5f439 Backed out changeset e30080454885 (bug 1222980) 2016-12-15 17:13:46 +01:00
Carsten "Tomcat" Book
ced1610284 Backed out changeset 6bf4393db489 (bug 1323369) for causing memory leaks on a CLOSED TREE 2016-12-15 17:11:02 +01:00
ctai
673b533118 Bug 1323369 - Make HTMLMediaElement::UnbindFromTree to follow WhatWG HTML spec. r=jwwang
W3C HTML5 spec isn't very actively maintained now. WhatWG HTML spec:
When a media element is removed from a Document, the user agent must run the following steps:
Below is the related statement in WhatWG HTML spec:
Await a stable state, allowing the task that removed the media element from the Document to continue. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with .)
 If the media element is in a document, abort these steps.
 Run the internal pause steps for the media element.

MozReview-Commit-ID: H4EgPqj2YxD

--HG--
extra : rebase_source : 4f875b7cbd0ead4cf0d8ce191a3ba32fb6f6395b
2016-12-13 15:34:14 +08:00
ctai
d44c8978b2 Bug 1222980 - Dispatch |QueueLoadFromSourceTask| to main thread. And end the synchronous section and asynchronously await a stable state when the src is not set. r=jwwang.
Dispatch |QueueLoadFromSourceTask| to main thread to make sure the task will be executed later than loadstart event. And when the src get errors, we need to end the synchronous section.

MozReview-Commit-ID: EQ0jVIMnqoZ

--HG--
extra : rebase_source : 6651826ad8de361deda5bdc0a49b2c68dcf86220
2016-12-13 15:45:59 +08:00
Alastor Wu
ce4c37a7ff Bug 1320005 - don't show the 'play tab' icon for the media element without audio track. r=baku
MozReview-Commit-ID: K42I0yWaI7N

--HG--
extra : rebase_source : 6b2cd50bb327a644f9092c1e018203854d3d899f
2016-12-13 22:47:13 +08:00
Kaku Kuo
f3b6c19f63 Bug 1244768 part 9 - modify the play() method; r=alwu,bz,jwwang
4.8.12.8
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play

MozReview-Commit-ID: 5r4xOIQwOEr

--HG--
extra : rebase_source : a603e8865b8873a31fafdc7004d01bc2cd840d2c
2016-12-01 14:54:33 +08:00
Kaku Kuo
daf1b64ef4 Bug 1244768 part 8 - extract the HTMLMediaElement::CreateDOMPromise() utility; r=jwwang
MozReview-Commit-ID: 28NopfA8lgV

--HG--
extra : rebase_source : d1ff22945e40a3df99319fe6e712494906163551
extra : intermediate-source : b409ef682a189ffa0bbb79e84fa0b6bca84f145b
extra : source : 7b00c027ee6e7b85dcc65bb4e304f048aa85a944
2016-08-08 16:53:20 +08:00
Kaku Kuo
89e7d04f16 Bug 1244768 part 7 - refactor the Play() and PlayInternal() methods; r=jwwang
MozReview-Commit-ID: CP00vERdWMv

--HG--
extra : rebase_source : 87a269a7183ad73b703aad6e3e873df7d79e4c62
extra : intermediate-source : 339778ed6f0b202d03b87436845fe0046e1ccc2c
extra : source : 3c3d972cd4a09ca6e3ec1ef60fdf679023229208
2016-08-08 14:52:00 +08:00
Kaku Kuo
a68e2e663c Bug 1244768 part 6 - modify the internal pause steps; r=jwwang
4.8.12.8
https://html.spec.whatwg.org/multipage/embedded-content.html#internal-pause-steps

MozReview-Commit-ID: Dt0VVbXLrhw

--HG--
extra : rebase_source : 1ed05897e67cd96de544e7f53c5f9ad1223aa27b
extra : intermediate-source : f6772d737e12b27f049e5d6235ecbbfbfc22f283
extra : source : 8e299b404ff6924f81e3bd3b0afdbe44a8dc957b
2016-08-18 20:05:13 +08:00
Kaku Kuo
599fed6bd5 Bug 1244768 part 5 - reject pending play promises while the playback reaching the end; r=jwwang
4.8.12.8
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-ended

MozReview-Commit-ID: H7Tw0XGzpW0

--HG--
extra : rebase_source : 409c1bb62baf1dbffff4d22c8d0494dc8a41147e
extra : intermediate-source : b5347204487023cdee9c04ef735addafa2124887
extra : source : f89758cbd1109ab92db1a644caa7c450a45757c0
2016-08-19 11:52:04 +08:00
Kaku Kuo
85f1c5b29d Bug 1244768 part 4 - call NotifyAboutPlaying() while ready state is changed; r=jwwang
4.8.12.7
https://html.spec.whatwg.org/multipage/embedded-content.html#ready-states

MozReview-Commit-ID: 1RUIU6Rw2SF

--HG--
extra : rebase_source : 81cb3107414d30d487e386519670e0f1864e3a6a
extra : intermediate-source : 4f51bbd1f1d68a6fa18f1502712a168171ba64ce
extra : source : 5c2b8029b3be04c739fca36b3e617c9996928a69
2016-08-05 16:42:31 +08:00
Kaku Kuo
bfa7d7c710 Bug 1244768 part 3 - modify the resource selection algorithm; r=jwwang
4.8.12.5
https://html.spec.whatwg.org/multipage/embedded-content.html#concept-media-load-algorithm
https://html.spec.whatwg.org/multipage/embedded-content.html#dedicated-media-source-failure-steps

MozReview-Commit-ID: DKFQC4v92Vi

--HG--
extra : rebase_source : ad5d4e782ce0af9879242d1c2830cf7c4461faac
extra : intermediate-source : e823b33657216c0ae0bf082c2d0820e9b6258eec
extra : source : 649a119bf21c1cd89d0d147604892147ab6692fc
2016-08-18 20:04:27 +08:00
Kaku Kuo
210ff4354f Bug 1244768 part 2 - modify media element load algorith; r=jwwang
4.8.12.5
https://html.spec.whatwg.org/multipage/embedded-content.html#media-element-load-algorithim

The living WHATWG spec has been changed since I implemented this patch.
Will update to the latest spec later.

MozReview-Commit-ID: 7U1AC2Ua83Z

--HG--
extra : rebase_source : d4b7c5103b29271cfdde5d180d7e7c8a65d89b2f
extra : intermediate-source : 616bc473295c8673e3cfae726b8a19c64b2906f1
extra : source : 69d8b411ee5f85139f3f40ce4bc7a4d7ad018b8d
2016-08-18 20:03:48 +08:00
Kaku Kuo
3cc7546ff4 Bug 1244768 part 1 - implement utilities which are the foundation of promise-based play operation; r=jwwang
In this patch, the following utilities are implemented:
(1) A list to keep pending promises of a HTMLMediaElement.
(2) A method to take pending promises out from the HTMLMediaElement.
(3) A global function to resolve the passed promises.
(4) A global function to reject the passed promises with an error code.
(5) A method to asynchronously resolve all pending promises of a HTMLMediaElement.
(6) A method to asynchronously reject all pending promises of a HTMLMediaElement.
(7) A method to dispatch a 'playing' event and resolve all the pending play promises.

All the above functionalities are defined at WHATWG 4.8.12.8:
https://html.spec.whatwg.org/multipage/embedded-content.html#list-of-pending-play-promises

This patch also implements two MediaEvent classes, nsResolveOrRejectPendingPlayPromisesRunner and nsNotifyAboutPlayingRunner, which help (5), (6) and (7).

This patch also implements a list of already-dispatched nsResolveOrRejectPendingPlayPromisesRunner; we keep tracing these tasks because the load algorithm resolves/rejects all already-dispatched pending play promises (in patch 2).

MozReview-Commit-ID: EUirNqDfttk

--HG--
extra : rebase_source : e48196e77341926900747b3f9477c5ee9ed28f62
extra : intermediate-source : 9b349c0e9eedad8822a1b8e8ef375ac6cb0b635a
extra : source : 75ee3b084edb68709503c98ad7b72850af7bb9c8
2016-12-08 14:34:39 -10:00
JW Wang
a7e9648832 Bug 1322087. Part 2 - move readyState to HAVE_ENOUGH_DATA when we have no more data to fetch. r=cpearce
http://searchfox.org/mozilla-central/rev/dc8cf05768b83a6ef0b4039edd6efddd56ee4109/dom/media/MediaDecoderStateMachine.cpp#1065
Changing nextFrameStatus to UNAVAILABLE might change readyState to HAVE_CURRENT_DATA and cause 'waiting' to fire.
It doesn't make sense to fire 'waiting' at the end of playback.

http://searchfox.org/mozilla-central/rev/dc8cf05768b83a6ef0b4039edd6efddd56ee4109/dom/html/HTMLMediaElement.cpp#5423
Note the check for Ended() doesn't work as expected to prevent 'waiting' from firing at the end of playback
because of the way how TailDispatcher schedules stateChange tasks.

This patch keeps readyState in HAVE_ENOUGH_DATA when playback is near the end for wanting no more data.
readyState will change to HAVE_CURRENT_DATA when the playing state of MediaDecoder is changed to PLAY_STATE_ENDED.

MozReview-Commit-ID: 6EspaD2hhx

--HG--
extra : rebase_source : 345aad2757d684e24863ae2daf506b035955efe7
extra : source : 56736efbab04a5c2d66faf2514bac93acf4c79f7
2016-12-07 10:41:33 -10:00
JW Wang
8e49c2b21d Bug 1322087. Part 1 - move |if (!mFirstFrameLoaded)| up to save some duplicate checks. r=cpearce
MozReview-Commit-ID: 77duxxtEAQP

--HG--
extra : rebase_source : 19810302dff31bdc02f12d79d1518ad9793fabc0
extra : source : bd86f44a0c38b8d60fafd8bdb26bdb786662c90f
2016-12-06 15:54:51 -10:00
Kaku Kuo
36f4bc694f Bug 1321497 - correct the logic of resuming from AudioChannel; r=alwu,jwwang
MozReview-Commit-ID: JxeqdzADlrU

--HG--
extra : rebase_source : 0263f14e4cdf482150af2a1697c201cedbe5ddcb
2016-12-01 16:30:18 +08:00
Alastor Wu
24c6192cfe Bug 1321410 - stop agent after cycle collection. r=jwwang
The crash reason seems the mOwner has been released, so we shouldn't call any method which would call mOwner.
The AudioChannelAgentCallback could only be called from two parts, one is from mOwner, another is from AudioChannelService (via AudioChannelAgent).
We don't want this class be called after mOwner was released, we should disconnect it from AudioChannelService.
Calling NotifyStoppedPlaying() can unregister agent from service, so service won't call agent anymore.
Therefore, no one would call AudioChannelAgentCallback after CC happened.

MozReview-Commit-ID: 7HY4KpciacB

--HG--
extra : rebase_source : 228c4988cd5aaae7b8b5c10463eb8445a8771d62
2016-12-04 11:02:10 +08:00
Bill McCloskey
2336b52695 Bug 1318506 - Label some common runnables with a DocGroup (r=ehsan)
MozReview-Commit-ID: 19gyZRfbzXP
2016-12-01 15:00:13 -08:00
Kaku Kuo
16e7762061 Bug 1321196 part 2 - rework the IsAllowedToPlay policy; r=alwu,jwwang
MozReview-Commit-ID: 8mrXoLRK42y

--HG--
extra : rebase_source : 1198c795e10476a696cf1a7046dd1d48dea7e44b
2016-11-30 16:01:36 +08:00
Kaku Kuo
e0595cae1a Bug 1321196 part 1 - typo correction; r=alwu
MozReview-Commit-ID: 4EodGXfjb8i

--HG--
extra : rebase_source : 76fd88aed1f46efd3dc5b7086f11ba7bddd2abac
2016-11-30 14:43:41 +08:00
ctai
32abedf65d Bug 1133483 - Dispatch |NoSupportedMediaSourceError| to main thread in |SelectResource|. r=jwwang
We need to end the synchronous section when the src attribute is empty and then run the "failed with elements step" in non-sync section.

MozReview-Commit-ID: DJ7GYqa6aI5

--HG--
extra : rebase_source : 41f4312408a62497a52e301cfacc2ac209e89bd4
2016-11-18 11:04:36 +08:00
Alastor Wu
3e46cb5b86 Bug 1309162 - part7 : wrap custom policy function. r=jwwang
MozReview-Commit-ID: EdjzMi90ukx

--HG--
extra : rebase_source : c9b3d9a55031fbf2421276cc9b16928af9b164a8
2016-11-29 12:40:47 +08:00
Alastor Wu
448b9c9c09 Bug 1309162 - part6 : remove useless comment. r=jwwang
These comments should be removed after landing bug1302350.

MozReview-Commit-ID: 7N0cWImZDDI

--HG--
extra : rebase_source : ee78246f4bb7f7a1dc2c95f08295e5159312f498
2016-11-29 12:40:45 +08:00
Alastor Wu
5b64c297d2 Bug 1309162 - part5 : only set the audible state when stream starts playing. r=baku
If input is a media stream, we would always regard it as audible when it's playing.
We won't need to set it as non-audible.

MozReview-Commit-ID: 8mzTsAkt6lG

--HG--
extra : rebase_source : f406542c2b8a9a349e14d199108d37ce57e9a223
2016-11-29 12:40:43 +08:00
Alastor Wu
6bcf0cf537 Bug 1309162 - part4 : remove checking for mPlayingBeforeSeek. r=baku
In previous patch, we removed UpdateAudioChannelPlayingState() from AddRemoveSelfReference(), now we
don't call UpdateAudioChannelPlayingState() during the seeking. So we don't need to afraid to stop
audio channel agent during the seeking.


MozReview-Commit-ID: GTuIRB24zlq

--HG--
extra : rebase_source : fb09137fd578adc9332eff8eee41891980157cf9
2016-11-29 12:40:41 +08:00
Alastor Wu
368697789a Bug 1309162 - part3 : modify the place calling UpdateAudioChannelPlayingState(). r=baku
UpdateAudioChannelPlayingState() should only be called when following attributes changed.
eg. pause/ready state/error/owner document's visibility/exteral source stream.

Therefore, we don't need to call this function in FinishDecoderSetup() and AddRemoveSelfReference().

Remove AutoNotifyAudioChannelAgent is because now we don't check HasAudio() for IsPlayingThroughTheAudioChannel().

MozReview-Commit-ID: 4VTHIAdAqX1

--HG--
extra : rebase_source : 5ee4cabd543fe43b4e51fa4ce68af083c8fd8e1a
2016-11-29 12:40:39 +08:00
Alastor Wu
f8bfec29ce Bug 1309162 - part2 : remove audio channel code from media element. r=jwwang
Remove the audio channel related codes.

MozReview-Commit-ID: Fc09gDDF21a

--HG--
extra : rebase_source : 1312437cabff8c4186df82e0f59e94a1c2ab45e4
2016-11-29 12:40:35 +08:00
Alastor Wu
4316cc30a4 Bug 1309162 - part1 : create a separate class to handle audio channel releated stuffs. r=baku,jwwang
In order to keep the media element's code clear (spec code only), we want to remove our
custom policy code out from media element. This new class will handle all audio channel
related stuffs, eg. mute/unmuted operation from tab audio indicator, play/resume from
Fennec's media control.

MozReview-Commit-ID: 5mDqDBTnBOr

--HG--
extra : rebase_source : cdb0a4b67c3e96bede79f61cc9d79b920517f139
2016-11-29 12:40:32 +08:00
Wes Kocher
52efb60291 Backed out 7 changesets (bug 1309162) for valgrind failures a=backout
Backed out changeset 3f0ad2d2c594 (bug 1309162)
Backed out changeset 17c744162fbe (bug 1309162)
Backed out changeset 2015de6577af (bug 1309162)
Backed out changeset fe1771c91309 (bug 1309162)
Backed out changeset b5ab5eae225d (bug 1309162)
Backed out changeset 16ceabbf8eef (bug 1309162)
Backed out changeset 6b09c6adcfa5 (bug 1309162)
2016-11-28 13:16:31 -08:00
Alastor Wu
ea67dfa463 Bug 1309162 - part7 : wrap custom policy function. r=jwwang
MozReview-Commit-ID: EdjzMi90ukx

--HG--
extra : rebase_source : 6bfc2fa4638b5a2200087961bf4842f8b482cc66
2016-11-28 10:23:14 +08:00
Alastor Wu
ff1cca9a1e Bug 1309162 - part6 : remove useless comment. r=jwwang
These comments should be removed after landing bug1302350.

MozReview-Commit-ID: 7N0cWImZDDI

--HG--
extra : rebase_source : b259780a2c901449d72dfcf1280de72cae890ade
2016-11-26 02:35:23 +08:00
Alastor Wu
7af99e933f Bug 1309162 - part5 : only set the audible state when stream starts playing. r=baku
If input is a media stream, we would always regard it as audible when it's playing.
We won't need to set it as non-audible.

MozReview-Commit-ID: 8mzTsAkt6lG

--HG--
extra : rebase_source : 2eaa6f1d92ef2f4048fae61ed99739157cf08287
2016-11-26 02:35:20 +08:00
Alastor Wu
f15425595d Bug 1309162 - part4 : remove checking for mPlayingBeforeSeek. r=baku
In previous patch, we removed UpdateAudioChannelPlayingState() from AddRemoveSelfReference(), now we
don't call UpdateAudioChannelPlayingState() during the seeking. So we don't need to afraid to stop
audio channel agent during the seeking.


MozReview-Commit-ID: GTuIRB24zlq

--HG--
extra : rebase_source : 20cae16efabd296f4b3c404886364aaa92db5df6
2016-11-26 02:35:18 +08:00
Alastor Wu
202cfad46d Bug 1309162 - part3 : modify the place calling UpdateAudioChannelPlayingState(). r=baku
UpdateAudioChannelPlayingState() should only be called when following attributes changed.
eg. pause/ready state/error/owner document's visibility/exteral source stream.

Therefore, we don't need to call this function in FinishDecoderSetup() and AddRemoveSelfReference().

Remove AutoNotifyAudioChannelAgent is because now we don't check HasAudio() for IsPlayingThroughTheAudioChannel().

MozReview-Commit-ID: 4VTHIAdAqX1

--HG--
extra : rebase_source : 7f196581fb2e5a7e75afef27d874522986d2cdc5
2016-11-26 02:34:49 +08:00
Alastor Wu
59b85ce47d Bug 1309162 - part2 : remove audio channel code from media element. r=jwwang
Remove the audio channel related codes.

MozReview-Commit-ID: Fc09gDDF21a

--HG--
extra : rebase_source : 08aa5c042924de7f0c9a9dffd3f71ecfa59e7a05
2016-11-26 02:34:42 +08:00
Alastor Wu
b32367de75 Bug 1309162 - part1 : create a separate class to handle audio channel releated stuffs. r=baku,jwwang
In order to keep the media element's code clear (spec code only), we want to remove our
custom policy code out from media element. This new class will handle all audio channel
related stuffs, eg. mute/unmuted operation from tab audio indicator, play/resume from
Fennec's media control.

MozReview-Commit-ID: 5mDqDBTnBOr

--HG--
extra : rebase_source : e9d4c3a41ce9a994ef4d44f059537a69f27c7c1e
2016-11-26 02:34:39 +08:00
Kilik Kuo
de713f4c77 Bug 1319686 - Remove the use of AutoNoJSAPI from HTMLMediaElement::NotifyAudioChannelAgent r=jwwang
MozReview-Commit-ID: FMKloJPpT93

--HG--
extra : rebase_source : 8796cdb9085882c319234595d5fa9aef67ba6532
2016-11-23 18:16:31 +08:00
Alastor Wu
ba429ab233 Bug 1301055 - part4 : special error dispatching stragedy for Fennec. r=jwwang
On Fennec, we would use external app (Android view) to play the media whih is
unsupported by gecko. We implement some special logic in error sink.

(1) dispatch "OpenMediaWithExternalApp" event
we use this event to start the android video player

(2) doesn't dispatch "error" event
some JS players won't let user to trigger play() again after receving the "error".
So we don't dispatch that event if we want to play the unsupported media more than once.

MozReview-Commit-ID: 7fZK5hdvaOG

--HG--
extra : rebase_source : 929db331c22e31a74f76dfa89a99a8adac65d0f6
2016-11-24 10:24:08 +08:00
Alastor Wu
a455141cb1 Bug 1301055 - part2 : create a error sink to handle media element's error related event. r=bkelly,jwwang
Error sink would be response for the error handling, we could write different
error dispatching stragedies for different situation. eg. if we can play
unsupported type media with external app, we won't dispatch the "error" event on fennec.

MozReview-Commit-ID: Lm4x9ksspAY

--HG--
extra : rebase_source : 05331714425ea111d21f06fc03abfc1b016654ca
2016-11-24 10:24:04 +08:00
Kilik Kuo
e883edbbf2 Bug 1316758-Remove nsContentUtils::LegacyIsCallerChromeOrNativeCode and IsCallerChrome calls from HTMLMediaElement. r=cpearce
MozReview-Commit-ID: 47pOATtfflP

--HG--
extra : rebase_source : 43123ebd61a2730b3ccdeaccfaf4dfccfb0cbe55
2016-11-18 10:30:00 +08:00
Alastor Wu
1c128b5ce5 Bug 1317167 - only need to do the untrust JS checking in play(). r=jwwang
The first checking condition in the IsAllowedPlay() is used to prevent the play() operation
is called by untrusted JS when media.autoplay.enabled=false. Therefore, we don't need to check
that in CanActivateAutoplay().

MozReview-Commit-ID: 6yqoG8ISyra

--HG--
extra : rebase_source : a3e52a1a5591691f503d7d4ca78dda63c05aef27
2016-11-17 15:09:59 +08:00
Bryce Van Dyk
51b7a05529 Bug 1298027 - Shut down CDMs when a containing document becomes inactive. r=cpearce
The previous changeset against this bug relaxed the conditions under which the
CDM and associated objects were shut down. This was to address moving a tab to a
new window breaking EME videos. However, this had the unwanted side effect of
not shutting down those objects early enough when pages are closed.

This changeset introduces a new check to see if the containing document is
currently active, if not we shutdown the CDM. This means CDMs are shutdown on
time, while retaining the desired behaviour that CDMs should not be shut down on
moving tabs to new windows. Shutdowns previously happened because we shut down
if a page hide happened, which took place during a reparent.

MozReview-Commit-ID: K5CD3ej43Y0

--HG--
extra : rebase_source : 28fdc277a89c371ad204d5e545779a5950063494
2016-11-14 15:02:48 +13:00
Bryce Van Dyk
5dbd650b59 Bug 1298027 - Relax decoder shutdown and mediakey removal on MediaElement suspension. r=cpearce
This changeset relaxes the shutting down of decoders and removal of mediakeys
when suspending HTMLMediaElements. This should now only happen for adobe
primetime. This alleviates, for non-primetime CDMs, the issue of videos
breaking when moving an EME protected video from a tab to a new window.

These conditions can be relaxed as neither clearkey or widevine support
secure stop. This means we don't need to shutdown their decoders and keys to
signal a stoppage, as at this stage, doing so doesn't give us secure stop and
instead means that playback is busted when we try to resume.

MozReview-Commit-ID: 3MGNXGGDVLS

--HG--
extra : rebase_source : cbf46b3da089f79d9b6729a02997d1a0a12b68a7
2016-10-31 10:55:19 +13:00
Alastor Wu
a97a900bc3 Bug 1315551 - part2 : check we have initialized agent when we want to call the agent's function. r=jwwang
Because the agent's initialization might fail if we don't get the valid inner window, we need to
check whether the agent exists before calling the agent's method.

MozReview-Commit-ID: IUuvyGh7CMd

--HG--
extra : rebase_source : 54d0811aad736abdbac5ae7c3cd8cfebed88923a
2016-11-08 11:08:02 +08:00
Phil Ringnalda
2d0fad04f6 Backed out changeset 87b698764664 (bug 1315521) for jetpack failures in test-leak-tab-events.js.test 2016-11-07 21:01:45 -08:00
Alastor Wu
50ccc2b3a2 Bug 1315521 - remove CC for audio channel agent. r=jwwang
Because audio channel agent uses weak ref to HTMLMediaElement, so we don't need to add it into the CC list.

MozReview-Commit-ID: 4cFfDUlbMFB

--HG--
extra : rebase_source : 4d595397d11e2e3c46cce17df148bea8f77f92e8
2016-11-08 11:03:23 +08:00
JW Wang
544c3e8512 Bug 1314547. Part 1 - remove the call to MediaDecoder::SetMediaSeekableOnlyInBufferedRanges(). r=cpearce
MozReview-Commit-ID: 52BESjY8f74

--HG--
extra : rebase_source : 132b2c54247864f1e594ba1da12108449ba2bce5
extra : source : b177332ca07279b2b577e9ac1ccb62c01bbb8cbe
2016-11-02 17:11:29 +08:00
JW Wang
e6bb1c3c9c Bug 1314529. Part 1 - remove the call to MediaDecoder::SetMediaSeekable(). r=cpearce
MozReview-Commit-ID: 1vsazRU9KNw

--HG--
extra : rebase_source : ec7a318b6e28322493f39bee59b34967e59c25c8
extra : source : 8495dbe9dae7566dd26e82fdc4194335542f9b68
2016-11-02 14:39:18 +08:00
Jean-Yves Avenard
a50a86289f Bug 1302656: P1. Don't detach mediasource when error occurs. r=jwwang
MozReview-Commit-ID: 88EIb4XXcdR

--HG--
extra : rebase_source : 3e09f64f2af6993f055e353411d6f782527904ed
2016-11-01 20:33:33 +11:00
Wes Kocher
8fa7074c50 Backed out 2 changesets (bug 1302656) for WinXP wpt failures a=backout
Backed out changeset e8ce7f515092 (bug 1302656)
Backed out changeset 416dbe42e4a3 (bug 1302656)
2016-11-04 14:51:27 -07:00
Jean-Yves Avenard
b9350d8857 Bug 1302656: P1. Don't detach mediasource when error occurs. r=jwwang
MozReview-Commit-ID: 88EIb4XXcdR

--HG--
extra : rebase_source : 90ae19d74ab13ed5f6e301be4862eaed59f396db
2016-11-01 20:33:33 +11:00
Alastor Wu
9e8e7969e0 Bug 1302350 - part6 : ensure loading process doens't be interrupted even media element can't be played. r=jwwang
We don't want to stop the loading process even we canceled the play operation.

MozReview-Commit-ID: FyPqBlDKYo0

--HG--
extra : rebase_source : fdbc4390a7763bdbe26e8b809d977234bb5360ea
2016-11-02 14:22:35 +08:00
Alastor Wu
a7414dc3e6 Bug 1302350 - part4 : refactor the media-blocking mechanism. r=jwwang
The old way is to start playing first, and then block the media element. This
way is too complicated because it involves lots of interal state and isn't intuitive.

The new way is to ignore the play if the media element should be blocked. It's
easy to know and we doesn't need to keep any internal states because we don't play
the media element.

MozReview-Commit-ID: B20e0pvXES4

--HG--
extra : rebase_source : 6bff5447783c2997050e5c69884afe2c85ddf382
2016-11-02 14:22:24 +08:00
Alastor Wu
c2f555c0fd Bug 1302350 - part2 : provide a method to check whether the agent was started. r=baku
Since the agent is created in beginning in patch1, we need another way to know
whether we have already called notifyStartedPlaying().

MozReview-Commit-ID: 5YNhwEl5Xfp

--HG--
extra : rebase_source : 6a2913e5d81591faf1a7383d9fcb9db2cf3f83d3
2016-11-01 17:46:09 +08:00
Alastor Wu
8dda44f0e7 Bug 1302350 - part1 : create audio channel agent in the beginning. r=baku
We create audio channel agent in the beginning in oreder to use some agent's methods.
But the agent is still started after media element starting playing.

MozReview-Commit-ID: KPGb7snB2t7

--HG--
extra : rebase_source : dba4b687f572d520481721f48a0b4e9796f73e1f
2016-11-01 17:46:07 +08:00
Andreas Pehrson
bc27f7ec47 Bug 1301675 - Uncomment assertion for when removed live track was not found. r=jib
It needs an extra guard for when we're an audio element and a live video track
was removed. That's ok and we should ignore it.

MozReview-Commit-ID: FVw3lDKd4oU

--HG--
extra : rebase_source : 3156abdcd5c57932e8edb61e78ffb568e4edbf2a
2016-09-23 16:56:39 +02:00
Andreas Pehrson
825d513165 Bug 1301675 - Rename BasicUnstoppableTrackSource to BasicTrackSource. r=jib
They are not unstoppable any longer. We just don't forward Stop() to the real source.

MozReview-Commit-ID: FdFccMsD3eb

--HG--
extra : rebase_source : e29a1abb8f2060cb72399d61d91ca3a00128f08c
2016-09-16 15:19:28 +02:00
Andreas Pehrson
46a4616487 Bug 1301675 - Clarify why we don't need to do anything on DecoderCaptureTrackSource::Stop(). r=jib
MozReview-Commit-ID: H1zaO1FKWvK

--HG--
extra : rebase_source : ec577dbb20db6b112a6981c21a291d6c539aaee0
2016-09-16 11:10:17 +02:00
Andreas Pehrson
220b0176e0 Bug 1301675 - Implement StreamCaptureTrackSource::Stop. r=jib
MozReview-Commit-ID: 2qwNba6bA80

--HG--
extra : rebase_source : 703bf47ec1c838a4c0cb9bb7d4d21dbfb361927a
2016-09-23 16:53:10 +02:00
Andreas Pehrson
159d4ead9e Bug 1301675 - Remove MediaStreamTrackSource::mIsRemote. r=jib
MediaStreamTrack.remote is no longer part of the spec.

MozReview-Commit-ID: BgHJ1zNIoWN

--HG--
extra : rebase_source : 11022eb420cbdb0c7aa5aa7814cf35330f4170b9
2016-09-12 15:59:58 +02:00
Andreas Pehrson
1532393ba1 Bug 1208316 - A media element should autoplay a MediaStream that becomes active. r=jib
MozReview-Commit-ID: 98H7REtqShI

--HG--
extra : rebase_source : 6f09c16929b9ac2b75f05bfcd874a4b429669783
2016-09-14 10:04:26 +02:00
Andreas Pehrson
367ed14d80 Bug 1208316 - HTMLMediaElement.ended should follow MediaStream.active. r=jib
MozReview-Commit-ID: CIJZz5khY8R

--HG--
extra : rebase_source : 6ca86aa8d77241e9ce1a199d7c71614ab72dd718
2016-09-14 10:02:23 +02:00
Andreas Pehrson
9d8d0aeb38 Bug 1208316 - Notify watchers on StreamListener::Forget(). r=jib
This makes sense because the result of StreamListener::NextFrameStatus depends
on mElement.

MozReview-Commit-ID: 8W7nGLpRxE1

--HG--
extra : rebase_source : 48f9c3c637eb01430446dbaf683e65008df19147
2016-09-13 10:42:28 +02:00
Andreas Pehrson
bffd28794f Bug 1208316 - Punch a hole for media element captureStream to only go inactive as source ends. r=jib
MozReview-Commit-ID: 3H0m3fYMw1Y

--HG--
extra : rebase_source : 0eedf84ee9360fada6b4f4d17cb7bdf296f861e8
2016-09-15 14:18:22 +02:00
Andreas Pehrson
d88a8a02fa Bug 1208316 - Rename MediaStreamTrack::NotifyEnded to OverrideEnded. r=jib
Better semantics for what I want to do with NotifyEnded in later patches in the bug.

MozReview-Commit-ID: 8X0BdiVncNo

--HG--
extra : rebase_source : f36f5a17f2294c6ad9b5db2593b41eb8cd8a9a15
2016-09-08 11:06:21 +02:00
Andreas Pehrson
a8d8f14cac Bug 1208316 - End a media element when its MediaStream source goes inactive. r=jib
MozReview-Commit-ID: 89LMDSsJLJP

--HG--
extra : rebase_source : 2746ee704d51724be7001fd746c5fcea92f36eb1
2016-09-08 13:42:36 +02:00
Sebastian Hengst
bd00edae92 Backed out changeset fc6a63bedaec (bug 1298027) for timing out in test_eme_stream_capture_blocked_case3.html on Windows 7 opt and pgo. r=backout a=backout
MozReview-Commit-ID: DR4bw1NuCga
2016-10-31 19:56:09 +01:00
Bryce Van Dyk
edd3737449 Bug 1298027 - Relax decoder shutdown and mediakey removal on MediaElement suspension. r=cpearce
This changeset relaxes the shutting down of decoders and removal of mediakeys
when suspending HTMLMediaElements. This should now only happen for adobe
primetime. This alleviates, for non-primetime CDMs, the issue of videos
breaking when moving an EME protected video from a tab to a new window.

These conditions can be relaxed as neither clearkey or widevine support
secure stop. This means we don't need to shutdown their decoders and keys to
signal a stoppage, as at this stage, doing so doesn't give us secure stop and
instead means that playback is busted when we try to resume.

MozReview-Commit-ID: 3MGNXGGDVLS

--HG--
extra : rebase_source : a13fd5fa570a6868af6c3ed7b3dbfab173a9ffef
2016-10-31 10:55:19 +13:00
Ryan VanderMeulen
a41f7d1058 Merge autoland to m-c. a=merge 2016-10-29 09:12:45 -04:00
Chris Pearce
812726afd0 Bug 1308821 - Ensure ClearKey doesn't parse a keyids initdata format session type parameter. r=kikuo
The specification doesn't require there to be a 'type' member of
the keyids init data format.

MozReview-Commit-ID: 7mOm7KwyyuC

--HG--
extra : source : c9fb674f3cb8dff4fe8734e0426e67825878015d
2016-10-09 20:42:01 -07:00
Jean-Yves Avenard
7bf85d7878 Bug 1312886: P7. Handle case where nextFrameStatus jumps straight to NEXT_FRAME_UNAVAILABLE_BUFFERING. r=jwwang
Under some circumstances, we will go from NEXT_FRAME_AVAILABLE to NEXT_FRAME_UNAVAILABLE_BUFFERING directly. We handle this condition now

MozReview-Commit-ID: JVAQhsgzSp2

--HG--
extra : rebase_source : e615e17d49bd35ecb9cb7db84501489ec5e12903
2016-10-27 21:12:20 +11:00
Jean-Yves Avenard
27831447c8 Bug 1312886: P2. Never move past HAVE_FUTURE_DATA if we're waiting for a key, r=cpearce
MozReview-Commit-ID: KWERB7zWXPZ

--HG--
extra : rebase_source : cb2ff70285120a4a87c18951a352743623a879b4
2016-10-27 16:36:37 +11:00
Alastor Wu
10ed91bc28 Bug 1302453 - part1 : send new gecko event when media is resumed. r=baku
We uses "media-playback" event to notify fennec media control about media start
and end. However, if we resume media which was paused by media control, it won't
send any notification to JAVA side so that the MediaControlService can't change
the correct playing icon.

Therefore, we create new event to inform this situation.

MozReview-Commit-ID: zScaHxvHXM

--HG--
extra : rebase_source : e1434840de36d8621a58fc7406b0f42673a2f3db
2016-10-27 09:59:55 +08:00
Phil Ringnalda
62997f0b4b Backed out changeset 9b132e52aa0a (bug 1308821) for wpt encrypted-media/clearkey timeouts and unexpected passes 2016-10-26 19:07:49 -07:00
Phil Ringnalda
d41a1c1da4 Merge m-c to autoland 2016-10-26 18:57:56 -07:00
Chris Pearce
b6dbc9a4a9 Bug 1308821 - Ensure ClearKey doesn't parse a keyids initdata format session type parameter. r=kikuo
The specification doesn't require there to be a 'type' member of
the keyids init data format.

MozReview-Commit-ID: 7mOm7KwyyuC

--HG--
extra : rebase_source : 88b729ae0b0f851763bbd06ec48bae2d6ac1c47e
2016-10-09 20:42:01 -07:00
Andreas Pehrson
a4daeb341b Bug 1294605 - Media element captureStream() streams shouldn't keep devices alive. r=jib
MozReview-Commit-ID: 3tSFbygTZs1

--HG--
extra : rebase_source : 4fabcaa16c28ca82c79361206faad976c296fa35
extra : intermediate-source : aec40f5bbff71e0d1e9234f06e558daf8783ffff
extra : source : 493751ad2c24c188ae1c01d5c398dcdd7445f581
2016-08-29 16:27:11 +02:00
Jean-Yves Avenard
eeb042a75d Bug 1312594: Do not clear resource when error occurs. r=jwwang
MozReview-Commit-ID: EFrURgSYvdb

--HG--
extra : rebase_source : 1ceed3c71b7da7500cab6b37780a236ecca729dc
2016-10-25 13:36:26 +11:00
Chris Pearce
0833297e6b Bug 1310548 - Delay firing of 'waitingforkey' until all decoded data has been rendered. r=jya
This means 'waitingforkey' will be fired at a predictable time.

MozReview-Commit-ID: HMt1RbgrbuR

--HG--
extra : rebase_source : cb8c36eacd3e78ae5105cd30da7a51d8241dbd5b
2016-10-17 14:16:54 +13:00
Sebastian Hengst
775580cb98 Backed out changeset 443a94083e00 (bug 1294605)
--HG--
extra : source : b82347df2602f07c7b190f0fbf7a6991d6022044
2016-10-20 20:03:16 +02:00
Andreas Pehrson
8651bced6e Bug 1294605 - Media element captureStream() streams shouldn't keep devices alive. r=jib
MozReview-Commit-ID: 3tSFbygTZs1

--HG--
extra : rebase_source : ae29940ba7c2fdedec35c3c010317a4f1d74d092
extra : source : 493751ad2c24c188ae1c01d5c398dcdd7445f581
2016-08-29 16:27:11 +02:00
Iris Hsiao
b28cf9af87 Backed out changeset 8e21afb88dbb (bug 1294605)
CLOSED TREE
2016-10-26 17:54:51 +08:00
Andreas Pehrson
7e7913f113 Bug 1294605 - Media element captureStream() streams shouldn't keep devices alive. r=jib
MozReview-Commit-ID: 3tSFbygTZs1
2016-08-29 16:27:11 +02:00
Sebastian Hengst
3c1524e5e0 Bug 1306137 - remove b2g camera code: Remove dom/camera/ and code which depends on it. r=aosmond,bkelly
MozReview-Commit-ID: 7gvZrDtmcZP

--HG--
extra : rebase_source : 31f06357fdc36566465668f55bf3fcc5402fe9e0
2016-10-04 20:16:28 +02:00
Gerald Squelart
05ae515444 Bug 1176218 - p4. Use DecoderTraits::CanHandleContentType in HTMLMediaElement - r=jya
MozReview-Commit-ID: IQFvgI6h1tE

--HG--
extra : rebase_source : 11bcd26aaf0fd74fb02416b1d0c9b4c2b5d73345
2016-09-26 13:31:57 +10:00
Alastor Wu
10174cc9eb Bug 1308119 - replace nsIAudioChannelAgent with AudioChannelAgent. r=baku
Since I want to use more agent's functions in MediaElement and I don't think these functions need to be exposed on IDL level. (for other languages binding)

Therefore, I want to use AudioChannelAgent directly in MediaElement.

MozReview-Commit-ID: 43FvDeLpZPt

--HG--
extra : rebase_source : 78741d791eb66cfb6223866ce823f217e3438fdb
2016-10-07 10:35:01 +08:00
Alastor Wu
c861a7e452 Bug 1302084 - the error checking should have highest priority. r=baku
MozReview-Commit-ID: 9QC5CG7p28M

--HG--
extra : rebase_source : dfbe93739c2dbe6b8e6640fd9ef54a8c1f4dd040
2016-10-06 12:07:33 +08:00
Alastor Wu
0331c39ab1 Bug 1303554 - part2 : remove the b2g specific checking in IsCurrentlyPlaying(). r=baku
MozReview-Commit-ID: 5kUJc24uEIH

--HG--
extra : rebase_source : b1b059a0b3d579f301d3aa9bde336ecf86fadd02
2016-10-05 10:07:54 +08:00
Alastor Wu
94f2fcca3d Bug 1303554 - part1 : notify start-playing after having enough data. r=baku
Regression by bug1262053 because of removing the current playing checking.
It would cause that the media control on Fennec shows too early and some media
elements would also generate the media control even it doens't have available
source.

Therefore, I think we still need to add this checking back.

MozReview-Commit-ID: 1m1ywmLmpSe

--HG--
extra : rebase_source : 30741b0e7bf1bb15349caaf1ecbcdad8cd92dcc3
2016-10-05 10:07:49 +08:00
Chris Pearce
efc3fcbec9 Bug 1307595 - Fixup bad merge conflict resolution from Bug 1300654/8eef5d2cc850. r=partial-backout
8eef5d2cc850 in Bug 1300654 incorrectly resolved a merge conflict and backed
out part of the fix for Bug 1280829. Relanding.

MozReview-Commit-ID: 6DIkUrc9R4t
2016-10-05 13:12:03 +13:00
JW Wang
4988b09533 Bug 1239899. Part 2 - per spec. await a stable state to pause the element when it is removed from the document. r=cpearce
MozReview-Commit-ID: BCCWgXmUchU

--HG--
extra : rebase_source : 4abe51e9ebce048db99fc6bff2b2d283bbb3acf1
extra : source : 18b3ff4dbb9654a159522c4cc64d2b41921c7f11
2016-09-23 16:16:43 +08:00
JW Wang
0a2c5a3d36 Bug 1239899. Part 1 - Remove ElementInTreeState for ELEMENT_NOT_INTREE and ELEMENT_INTREE are not used at all. We can use a bool flag to do the job. r=cpearce
MozReview-Commit-ID: 4htNy1dZODF

--HG--
extra : rebase_source : 32776b1201d156f6ed5b60e8b2609ba3abd586af
extra : source : 34900c8548e5527129b0af9cb4b25faa9127f305
2016-09-23 14:51:52 +08:00
JW Wang
1364ebc2ad Bug 1304134. Part 2 - per spec. fire 'playing' when autoplay is activated. r=cpearce
MozReview-Commit-ID: 4fFUvquMgEC

--HG--
extra : rebase_source : 5936561bf1a3143e5df8cfe8ae95c28c9d775821
2016-09-23 14:05:44 +08:00
JW Wang
77193cb7b1 Bug 1304134. Part 1 - per spec. (https://dev.w3.org/html5/spec-preview/media-elements.html#ready-states) 'playing' should be fired before activating autoplay. r=cpearce
Also replace the check for IsPotentiallyPlaying() with !mPaused because mReadyState >= HAVE_FUTURE_DATA guarantees playback is not ended.

MozReview-Commit-ID: HetaVDgYEW0

--HG--
extra : rebase_source : 94dd2156db419240ad4462208540e9f98f1c8050
2016-09-23 14:03:50 +08:00
Carsten "Tomcat" Book
762cd18602 Merge mozilla-central to autoland 2016-09-28 16:52:13 +02:00
James Andreou
a47ce92ac2 Bug 1282124 - Remove nsILoadInfo.usePrivateBrowsing and the SEC_FORCE_PRIVATE_BROWSING flag; r=smaug,jryans 2016-09-27 16:56:44 -04:00
James Cheng
48efb9caad Bug 1300654 Part1-Remove MOZ_EME from code base. r=cpearce,smaug
MozReview-Commit-ID: JboGO0w4tcE

--HG--
extra : rebase_source : abfe53f30081f74fc39c900cab48d08c7574bfec
2016-09-08 18:06:20 +08:00
Carsten "Tomcat" Book
ce8c91d458 Merge mozilla-central to mozilla-inbound 2016-09-22 11:56:22 +02:00
Chris Pearce
7a191ffc4f Bug 1304604 - Use EventTarget to simplyfy HTMLMediaElement.onencrypted implementation. r=smaug
MozReview-Commit-ID: EUpZX4ODgNj

--HG--
extra : rebase_source : dae4ac3da64b61bf282455f2b6e054e13e4cadc1
2016-09-22 16:25:38 +12:00
Chris Pearce
d42821ee80 Bug 1304247 - Implement HTMLMediaElement.onwaitingforkeys. r=smaug
MozReview-Commit-ID: DhNV30BfksS

--HG--
extra : rebase_source : 5fab8f1b3333ff8607c0325907fbe7214234c001
2016-09-21 14:10:26 +12:00
Chris Pearce
7e7b3c9f0f Bug 1280829 - Only block non-MSE content which is encrypted once it reaches load metadata. r=jya
Previously, we'd block loading of non-MSE content when there was a MediaKeys
attached, that is, we'd assume that all content was EME content if a MediaKeys
was attached. But some sites attach a MediaKeys and then load non-MSE non-EME
content, and that (despite being a bit silly) shouldn't fail.


MozReview-Commit-ID: 9LupWaehXim

--HG--
extra : rebase_source : 6db281feb27a61b49dc565d4d4562a3d2366fc89
2016-09-21 13:04:01 +12:00
Jean-Yves Avenard
e555d04fbf Bug 1303970: P2. Fix "If the media data fetching process is aborted by the user steps". r=jwwang
MozReview-Commit-ID: 6n91VY00gAo

--HG--
extra : rebase_source : 61aab7eecb527c55199a597db7b08681206c3f2f
2016-09-20 19:52:06 +10:00
Jean-Yves Avenard
3eae3b5916 Bug 1303970: P1. MEDIA_ERR_ABORTED can be returned even if readyState is HAVE_NOTHING. r=jwwang
So change assertion accordingly.

MozReview-Commit-ID: AuaDlyF0MAL

--HG--
extra : rebase_source : 60f1b34c8320d8ad47845bfd9d8f23e27d3a8620
2016-09-20 19:36:09 +10:00
JW Wang
5e9751305f Bug 1303347 - add assertions for debugging if Observe() could ever happen after Unsubscribe(). r=cpearce
MozReview-Commit-ID: 9XhGYI3fTqb

--HG--
extra : rebase_source : b42dce2b15cb044871e355090dade17abf651ee9
2016-09-20 11:27:46 +08:00
Jean-Yves Avenard
26629fd77e Bug 1302632: P4. Do not change network state to NETWORK_EMPTY. r=jwwang
There's no such step defined in the spec. Despite, this code can no longer be called when readyState is HAVE_NOTHING

MozReview-Commit-ID: 2fDoNHt1COp

--HG--
extra : rebase_source : d8b79acee85b00331f55153626038e26cd4a72c7
2016-09-15 16:20:43 +10:00
Jean-Yves Avenard
895efe36db Bug 1302632: P3. Provide failures details to error attribute. r=jwwang
MozReview-Commit-ID: 3eIXOF96UR4

--HG--
extra : rebase_source : eeeb298d46bd8c6957560e475b7b1c4728a392dc
2016-09-15 16:17:10 +10:00
Jean-Yves Avenard
8a54c1a711 Bug 1302632: P1. Set proper error code when readyState is HAVE_NOTHING. r=jwwang
MozReview-Commit-ID: CMQkW5pPDF2

--HG--
extra : rebase_source : f0286af0b2daa2f91bbea66ab7bcf6de1a6d2207
2016-09-14 16:45:52 +10:00
Phil Ringnalda
cd6041148f Backed out 5 changesets (bug 1302632) for forthcoming failures
Backed out changeset f2ced742d6aa (bug 1302632)
Backed out changeset 55e7962d4fc0 (bug 1302632)
Backed out changeset b20f7c887e6c (bug 1302632)
Backed out changeset 22772e4a9c72 (bug 1302632)
Backed out changeset 7d7558864a66 (bug 1302632)
2016-09-15 21:39:00 -07:00
Jean-Yves Avenard
4faaba2ab5 Bug 1302632: P4. Do not change network state to NETWORK_EMPTY. r=jwwang
There's no such step defined in the spec. Despite, this code can no longer be called when readyState is HAVE_NOTHING

MozReview-Commit-ID: 2fDoNHt1COp

--HG--
extra : rebase_source : baa542cdf3144db8b941c20f22548c67bfc06346
2016-09-15 16:20:43 +10:00
Jean-Yves Avenard
64dda2968c Bug 1302632: P3. Provide failures details to error attribute. r=jwwang
MozReview-Commit-ID: 3eIXOF96UR4

--HG--
extra : rebase_source : 7f5b03e3a6f5dbb40b16b1460132993b60d071e6
2016-09-15 16:17:10 +10:00
Jean-Yves Avenard
f359140d9d Bug 1302632: P1. Set proper error code when readyState is HAVE_NOTHING. r=jwwang
MozReview-Commit-ID: CMQkW5pPDF2

--HG--
extra : rebase_source : 2bd7828104b8f3ac5bb1d8bdc3f84b652300cabe
2016-09-14 16:45:52 +10:00
Boris Zbarsky
0fd831e559 Bug 1302304. Remove IDL bits that reference nsIDOMMediaError; it's not needed anymore. r=bkelly 2016-09-15 11:41:35 -04:00
Carsten "Tomcat" Book
9a2448ee1c Merge mozilla-central to mozilla-inbound 2016-09-14 12:11:09 +02:00
Jean-Yves Avenard
6a25692b20 Bug 1299072: P10. Pass decoding error details to media element's error attribute. r=jwwang
MozReview-Commit-ID: 49DurV9WI5S

--HG--
extra : rebase_source : 469e6ed4e222fb6d6ac34843c3c3346a044c6023
2016-09-11 00:56:09 +10:00
kaku@mozilla.com
9a1c3746b2 Bug 1299718 part 3 - call MarkAsContentSource() at where using video element as a source; r=gerald,kamidphish,mtseng
MozReview-Commit-ID: Kg6UpcsCi0P
2016-09-14 15:50:29 +10:00
kaku@mozilla.com
09ae2d424f Bug 1299718 part 2 - implement the MarkAsContentSource() API; r=gerald,kamidphish
MozReview-Commit-ID: 1eAdcMAmXSB
2016-09-14 15:50:29 +10:00
Kaku Kuo
5286ffa8da Bug 1284350. Reland on top of backouts "Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald" r=kaku
Instead of "not visible", "approximately visible", and "visible" (in display port) we now have "approximately not visible", and "approximately visible" which includes "visible".
2016-08-30 14:53:04 +08:00
Kaku Kuo
cca4120327 Bug 1284350. Reland on top of backouts "Bug 1282710 - Part 1 - implement the suspend and resume logics in HTMLMediaElement.cpp according to visibility events; r=cpearce r=kamidphish" r=kaku
Instead of "not visible", "approximately visible", and "visible" (in display port) we now have "approximately not visible", and "approximately visible" which includes "visible".
2016-07-04 13:26:40 +08:00
Timothy Nikkel
4a590050bf Bug 1284350. Backed out changeset 1bbb1ab928c7 (Bug 1282710 - Part 1 - implement the suspend and resume logics in HTMLMediaElement.cpp according to visibility events; r=cpearce r=kamidphish) 2016-09-12 00:19:06 -05:00
Timothy Nikkel
e7b23cbf0f Bug 1284350. Backed out changeset 06bf533a2bdd (Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald) 2016-09-08 18:07:36 -05:00
Wes Kocher
5cbc382303 Merge inbound to m-c a=merge 2016-09-07 17:54:24 -07:00
Andreas Pehrson
c166a2bf07 Bug 1300529 - Remove default arguments from HTMLMediaElement::CaptureStreamInternal. r=padenot
MozReview-Commit-ID: IL7odCBP74

--HG--
extra : rebase_source : 3202348010f7c22a218fd37ad745ae7332fb007c
2016-09-07 15:14:15 +02:00
Michael Layzell
c47fca1cd7 Bug 1018486 - Part 1: Changes in dom/, r=baku
MozReview-Commit-ID: 4tCUM4KRe81
2016-09-07 10:50:35 -04:00
Jeremy Chen
e42a48e81d Bug 1297306 - part5:create enum constructors for EnumTable. r=baku
Enable nsAttrValue::EnumTable to be initialized with enum. So, we could get rid
of the castings in EnumTable. Fix EnumTable initialization comment.

For those untyped enumerations, declare them with uint8_t, as to other typed
enumerations with type size larger than int16_t, force casting to int16_t.

Use {nullptr,0} instead of {0} to represent the last entry.

MozReview-Commit-ID: 7Dma3Apkmxj

--HG--
extra : rebase_source : b2289866c4c33d80c8e170727bf109d018d92f67
2016-09-07 10:20:17 +08:00
Gerald Squelart
693932c5aa Bug 1300459 - Pass MediaInfo by const-ref to SetMediaInfo - r=jya
MozReview-Commit-ID: 5KvCBHmI1JC

--HG--
extra : rebase_source : aece207d36682e1a6cc4125ef660e2eb8f41d92c
2016-09-05 14:23:23 +10:00
Alastor Wu
384eb5f086 Bug 1298777 - don't need to capture audio for media element without audio track. r=jwwang
MozReview-Commit-ID: DKRGiuTGjtg

--HG--
extra : rebase_source : b5c2705b623d6479cb729f2a51aef637e59b1e39
2016-09-02 18:47:10 +08:00
Andreas Pehrson
3e21f8275b Bug 1299451 - Fix mozCaptureStream() happening after setting src but before having metadata. r=jesup
MozReview-Commit-ID: CKC3n3Nt5IE

--HG--
extra : rebase_source : 9c8348403cedb2ac7f68bce9fc5f36cfe2e08357
2016-08-31 14:54:03 +02:00
Andreas Pehrson
a91bec92ad Bug 1299172 - HTMLMediaElement::StreamSizeListener spring cleaning. r=jesup
MozReview-Commit-ID: 25lt1j8t1Xh

--HG--
extra : rebase_source : e972d008c5e80059dd10031df38cf400cc6c9650
2016-08-31 14:32:13 +02:00
Andreas Pehrson
864bcdc3c4 Bug 1299172 - Fix media element StreamSizeListener calling DispatchToMainThreadAfterStreamStateUpdate off-MSG-thread. r=jesup
MozReview-Commit-ID: Cc2tJbEog20

--HG--
extra : rebase_source : 83731e3fe29a7813a51f70eff8a0f43a21f92e1d
2016-08-31 14:31:28 +02:00
Kaku Kuo
60576ca55c Bug 1299065 - invisible elements in the foreground should also be recorded; r=gerald
MozReview-Commit-ID: 56JBbJ743DM

--HG--
extra : rebase_source : 2ff2066735bb89db066540716436ec5b33bfb449
2016-08-30 14:53:04 +08:00