Commit Graph

340 Commits

Author SHA1 Message Date
Chris Pearce
17f4d00876 Bug 1463919 - Move ask autoplay permission check into AutoplayPolicy. r=jya
MozReview-Commit-ID: KJcVI6gtGXw
2018-06-26 14:16:13 +12:00
Chris Pearce
9efd9a949a Bug 1463919 - Have HTMLMediaElement ask for autoplay permission when playback otherwise blocked. r=jya
MozReview-Commit-ID: Ejv0UKBjSVf
2018-06-22 10:14:33 +12:00
Jeff Gilbert
70a22b2878 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Chris Pearce
0041d0ec9d Bug 1467350 - Make HTMLMediaElement::mPaused Watchable and update Wakelock status via a watcher. r=jya
We currently observe changes to HTMLMediaElement::mPaused via a hand-rolled
wrapper class. We can use use mozilla::Watchable<> and avoid rolling our
own equivalent here.

This also paves the way for using state watching on other observable state
in HTMLMediaElement.

MozReview-Commit-ID: 4lBlJiV15iG
2018-05-21 14:19:47 +12:00
Chris Pearce
795d5b7dc3 Bug 1464922 - Remove HTMLMediaElement::mAttemptPlayUponLoadedMetadata. r=bryce
We don't need to track this state anymore, as we don't need to delay calling
MediaDecoder::Play() or delay firing the "playing" event anymore.

MozReview-Commit-ID: E3B9l6ep7FP
2018-05-29 08:09:26 +12:00
Andreas Pehrson
aa5764e73b Bug 1453127 - Ensure TrackID uniqueness for captured MediaDecoder. r=jya 2018-05-29 10:21:51 +02:00
Andreas Pehrson
8addfac774 Bug 1453127 - Make sure decoder-captured tracks end when changing src. r=jya 2018-05-29 10:13:14 +02:00
Emilio Cobos Álvarez
a22d605d3a Bug 1454238: Remove nsINode::eMEDIA. r=bz
MozReview-Commit-ID: LPutL6PlrgG
2018-04-20 01:30:12 +02:00
Chris Pearce
b9c251eb10 Bug 1453176 - Add telemetry to report fulfilment of HTMLMediaElement.play(). r=bryce
We'd like to know the proportion of HTMLMediaElement.play() calls that are
rejected due to autoplay being blocked. There are also other conditions that
cause us to reject the promise returned by HTMLMediaElement.play(), so add
telemetry to report all the identifyable conditions under which play()
succeeds or fails.

MozReview-Commit-ID: AZ67WWXaowN
2018-04-13 20:28:39 +12:00
Chris Pearce
cbff3c0a1d Bug 1435134 - Don't play until we've reached metadata. r=bryce
We want to block playback of media which have an audio track, so if play()
is called before the load of the resource has loaded metadata, we need to
delay starting playback and resolving the play promise until we've figured
out whether the media has audio. So if play() is called before we've reached
readyState >= HAVE_METADATA, set a flag, and check that flag when we do
reach HAVE_METADATA and start the play and resolve the promise then.

MozReview-Commit-ID: 1K06NK2kfpw
2018-03-13 16:40:18 +13:00
Boris Zbarsky
5b75c1416d Bug 1449631 part 8. Remove nsIDOMEventTarget::GetEventTargetParent. r=smaug
MozReview-Commit-ID: 5wQ2LYrjUxf
2018-04-05 13:42:41 -04:00
Boris Zbarsky
6ea42abd76 Bug 1447098 part 2. Rename the NS_IMPL_FROMCONTENT macros to NS_IMPL_FROMNODE. r=mystor 2018-03-21 17:39:04 -04:00
Chris Pearce
cf783c6abe Bug 1445104 - Remove HTMLMediaElement::{mStatsShowing,mMediaSecurityVerified} as they're unused. r=jya
MozReview-Commit-ID: LtKw4Hj3M0G
2018-03-13 13:33:42 +13:00
Chris Pearce
dc786266e3 Bug 1445104 - Initialize HTMLMediaElement fields in class declaration. r=jya
This makes the constructor simpler.

MozReview-Commit-ID: 30CO1iBj4rH
2018-03-13 13:32:05 +13:00
Chris Pearce
8e88624abd Bug 1434804 - Pause autoplayed media if they become audible. r=kamidphish
Our autoplay blocking is trivial to defeat; just mute or volume=0 a video,
play(), and then unmute, and then you're playing audibly.

So this patch makes us pause() media that become audible atfter playback
has started.

MozReview-Commit-ID: 2RAtbohMGJO
2018-03-12 13:05:04 +13:00
Dan Glastonbury
60283ce4dd Bug 1440555 - P1: Allow setVisible to take effect before decoder creation. r=cpearce
MozReview-Commit-ID: GSNM6esm0fW
2018-02-27 14:33:41 +10:00
Chris Peterson
767d8b1589 Bug 1436263 - Part 3: Remove virtual from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42
2018-02-08 21:22:43 -08:00
Chris Peterson
6758bf6a84 Bug 1436263 - Part 1: Replace final override virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D
2018-02-05 22:46:57 -08:00
Kyle Machulis
9ce6990bc9 Bug 1407040 - Remove C++ usage of nsIDOMHTMLMediaElement; r=bz
MozReview-Commit-ID: 6MGS4UqKwrU
2018-02-14 21:22:38 -08:00
Kyle Machulis
b3a2a50103 Bug 1407040 - Change HTMLMediaElement QIs to FromContent calls; r=bz
MozReview-Commit-ID: JoHA0LbJnu9
2018-02-14 21:17:45 -08:00
Kyle Machulis
6404db48ec Bug 1407040 - Change HTMLMediaElement XPCOM Enums to WebIDL Enums; r=bz
MozReview-Commit-ID: 55GnbaL2HKl
2018-02-14 19:23:32 -08:00
Chris Pearce
e22e59f94c Bug 1431674 - Backed out changeset 9d197f1860e6. r=backout
MozReview-Commit-ID: wP0aucXgzA
2018-02-07 15:28:48 +13:00
Chris Pearce
20ed465a7f Bug 1431674 - Backed out changeset 3e22200b7e83. r=backout
The changes in bug 1324883 regressed YouTube, so back them out.

The changes in bug 1324883 were trying to cause the media cache to be cleared
on tab close and on CTRL+F5 reload (i.e. a bypass cache-reload) but they are
causing problems on YouTube,  which doesn't use the media cache and instead
uses MSE.

MozReview-Commit-ID: Hx2cehZ2wm1
2018-02-07 15:28:07 +13:00
Emilio Cobos Álvarez
8a71d3197b Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-25 17:50:10 +01:00
Emilio Cobos Álvarez
ecd202d763 Backout changeset e43f568b3e9a (bug 1423990) because some OSX-only code still doesn't build. r=me 2017-12-25 12:55:45 +01:00
Emilio Cobos Álvarez
b3956b6171 Bug 1423990: Move the last few attribute-related methods outside of nsIContent. r=bz
MozReview-Commit-ID: 8JZuS6O8f8W
2017-12-07 19:13:50 +01:00
Boris Zbarsky
ca91e3b7b4 Bug 1424474 part 3. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag
MozReview-Commit-ID: IjUEG5xwn5
2017-12-20 17:43:18 -05:00
Narcis Beleuzu
d9519f9913 Backed out 2 changesets (bug 1424474) for mochitest failures on test_bug494328.html r=backout on a CLOSED TREE
Backed out changeset 39d5991f02ba (bug 1424474)
Backed out changeset da3dec2fce06 (bug 1424474)
2017-12-21 02:55:27 +02:00
Boris Zbarsky
8ed3a61303 Bug 1424474 part 2. Make sure that we only pass non-system subject principals to setters/methods that later use that principal for loading security checks. r=kmag 2017-12-20 17:43:18 -05:00
Gerald Squelart
b25c781d32 Bug 1407810 - Implement HTMLMediaElement::Moz{Enable,Request}DebugLog - r=jwwang
MozReview-Commit-ID: 7Hhy6qBVjDk
2017-10-16 16:18:58 +11:00
Boris Zbarsky
0e5baea61e Bug 1419270 part 2. Use getter or setter specific NeedsSubjectPrincipal annotations more. r=qdot
MozReview-Commit-ID: KBwjFh3TMUg
2017-12-05 16:03:18 -05:00
Alastor Wu
f1a57c71e0 Bug 1420488 - part1 : bless media if media has started playing before. r=jwwang
If the media has started playing before, bless it and it would always be allowed
to autoplay.

MozReview-Commit-ID: 4GqMARLXULU
2017-11-29 18:59:56 +08:00
Sebastian Hengst
5c93ed8143 Backed out 2 changesets (bug 1420488) for eslint failures in toolkit/content/tests/browser/browser_autoplay_policy_play_twice.js. r=backout
Backed out changeset 92bd0fcb67d5 (bug 1420488)
Backed out changeset 0f211029517c (bug 1420488)
2017-11-29 17:31:28 +02:00
Alastor Wu
92ac80ff76 Bug 1420488 - part1 : bless media if media has started playing before. r=jwwang
If the media has started playing before, bless it and it would always be allowed
to autoplay.

MozReview-Commit-ID: 28X4TmG25aJ
2017-11-29 18:05:56 +08:00
Alastor Wu
de0fd34b42 Bug 1420192 - when disable autoplay, allow script calls play() once user triggered load() or seek(). r=jwwang
This patch is mainly reverting the changing of bug1382574 part3, but not all the same.

Since youtube would call load() when user clicks to play, and then call play()
later. For the old pref (checking user-input-play), we should still allow the
following play() even it's not triggered via user input. It's also same for
seeking, Youtube would call play() after seeking completed.

In this patch, we would allow the script-calling once play() if user has called load()
or seek() before that.

MozReview-Commit-ID: 1UcxRCVfhnR
2017-11-27 10:55:02 +08:00
Kris Maglione
48e53b3df5 Bug 1415352: Part 1a - Pass subject principal through to ParseAttribute. r=bz
This is necessary in order to parse style attributes using the subject
principal of the caller, rather than defaulting to the page principal.

MozReview-Commit-ID: GIshajQ28la
2017-11-01 20:35:52 -07:00
Alastor Wu
7baabd66f1 Bug 1382574 - part3 : remove HTMLMediaElement::mHasUserInteraction. r=jwwang
We won't need to check the whether the media element is interacted with user for
autoplay anymore.

MozReview-Commit-ID: 2tll9LtGyVR
2017-11-22 00:33:23 +08:00
Alastor Wu
b001a5a837 Bug 1382574 - part2 : remove HTMLMediaElement::GetHasUserInteraction(). r=bechen
MozReview-Commit-ID: 3MaumQvcR1q
2017-11-22 00:33:20 +08:00
Timothy Guan-tin Chien
f0261c6ad0 Bug 1327097 - Part III, Trap mouse/touch/pointer events in audio/video element, r=smaug
This patch implements HTMLMediaElement::GetEventTargetParent and set
aVisitor.mCanHandle to false to mouse/touch/pointer events, when
the media control is present. This tells the event dispatcher that
these events are supposed to be handled exclusively by the
videocontrol binding within the media element, and should not
dispatch nor consumed by the content.

MozReview-Commit-ID: BXWZX9SYsuC
2017-11-17 11:07:12 +08:00
JW Wang
71930eaf78 Bug 1417869. P3 - pass descriptive messages to NetworkError(). r=jya
MozReview-Commit-ID: 6yaFJvXG3g8
2017-11-17 11:07:30 +08:00
JW Wang
8b85f534ec Bug 1417869. P1 - show more descriptive messages for MEDIA_ERR_SRC_NOT_SUPPORTED when SelectResource() fails. r=jya
MozReview-Commit-ID: CySbHaJCaC5
2017-11-17 10:32:41 +08:00
Gurzau Raul
3fea16876e Backed out 3 changesets (bug 1327097) for eslint failures toolkit/content/tests/widgets/test_videocontrols.html:228 r=backout on a CLOSED TREE
Backed out changeset 09c0a4c56c78 (bug 1327097)
Backed out changeset c0c5ee67b3ef (bug 1327097)
Backed out changeset 82a6e4dc5da7 (bug 1327097)
2017-11-16 14:23:20 +02:00
Timothy Guan-tin Chien
bdc4d0a876 Bug 1327097 - Part III, Trap mouse/touch/pointer events in audio/video element, r=smaug
This patch implements HTMLMediaElement::GetEventTargetParent and set
aVisitor.mCanHandle to false to mouse/touch/pointer events, when
the media control is present. This tells the event dispatcher that
these events are supposed to be handled exclusively by the
videocontrol binding within the media element, and should not
dispatch nor consumed by the content.

MozReview-Commit-ID: BXWZX9SYsuC
2017-11-16 17:06:36 +08:00
Alastor Wu
54e0bff377 Bug 1336400 - part3 : move all autoplay checks to CanActivateAutoplay(). r=jwwang
1. move all checks to CanActivateAutoplay()
2. don't cache the pref's value in advance, it might cause wrong result
   if user changes pref after media was binded to tree.

MozReview-Commit-ID: 3BeOeaq9wGa
2017-11-13 18:43:55 +08:00
Alastor Wu
306a5abaab Bug 1336400 - part2 : remove MozAutoplayEnabled attribute from HTMLMediaElement. r=smaug
MozReview-Commit-ID: FK5F2zkXRjT
2017-11-13 18:42:47 +08:00
Chris Pearce
98bf109271 Bug 1416663 - Move Gecko/HTMLMediaElement specific stuff out of VideoFrameContainer. r=jwwang
MozReview-Commit-ID: 4giNMi8qsTZ
2017-11-13 16:09:23 +13:00
James Cheng
75643b86a6 Bug 1416141 - Remove Telemetry VIDEO_EME_PLAY_SUCCESS. r=kikuo
MozReview-Commit-ID: BtiD2tUmbE9
2017-11-10 14:49:37 +08:00
Kilik Kuo
853f877070 Bug 1395922 - [P3] Make HTMLMediaElement::SetMediaKeys asynchronously. r=cpearce
MozReview-Commit-ID: 5M8CTHMsmIh
2017-11-03 20:14:17 +08:00
Kilik Kuo
d6f2c41887 Bug 1395922 - [P1] Refactor code and move them into specific functions. r=cpearce
MozReview-Commit-ID: 9lwRH66Wllp
2017-11-03 14:35:32 +08:00
Csoregi Natalia
8293fe3698 Merge autoland to mozilla-central r=merge a=merge 2017-11-06 12:44:18 +02:00