Commit Graph

912 Commits

Author SHA1 Message Date
Andrea Marchesini
8ebf46d6e9 Bug 1458505 - grapping 'self' in mozilla::MakeScopeExit instead of '&' when needed, in DOM code, r=erahm 2018-05-03 08:09:58 +02:00
Jean-Yves Avenard
53beb24533 Bug 1457960 - P1. make MediaDecoder::Seek returns void. r=bryce
MozReview-Commit-ID: 2pbZprnYqcF
2018-04-30 19:58:11 +02:00
Andrea Marchesini
d173a7f829 Bug 1454889 - Remove createObjectURL()'s MediaStream overload, r=valentin 2018-04-24 16:19:51 +02:00
Chris Pearce
e6f6b952fc Bug 1453843 - Remove extraneous play promise reject. r=bryce
We already reject the play promises when we call Pause(), so this extra
reject is unnecessary.

MozReview-Commit-ID: 6LKw7hCwJPH
2018-04-20 17:54:08 +12:00
Chris Pearce
180e126957 Bug 1453843 - Ensure we fire "pause" event when rejecting play() promise. r=bryce
Bug 1435133 introduced a new path where we block autoplay and reject the play()
promise, but we didn't fire a "pause" event. This confuses YouTube's controls.

Additionally, even if we're not in a user generated event handler, we
unilaterally consider the media element blessed if execution reaches here:
https://searchfox.org/mozilla-central/rev/11a2ae294f50049e12515b5821f5a396d951aacb/dom/html/HTMLMediaElement.cpp#4110
We previously rejected before reaching here when not in a user generated event
handler, but now if play() is called before we've reached loadedmetadata, we
reject the promise if we're not in a non-event handler and bail out early, and
so we'll bless even if not in a user generated event handler. Meaning when we
do reach loadedmetadata, we think we were in a user generated event handler
when play() was originally called, and so we won't reject the play promise.

So this patch ensures we dispatch a "pause" event when we reject the play()
promise here. The WHATWG spec says we should do this when pausing anyway.

Note: calling our interal Pause() function when rejecting the play() promise
here breaks YouTube, as if we do that we fire a "timeupdate" event. So I opted
to manually code to fire the event here instead of just calling Pause()
everywhere we want to ensure we're paused.

MozReview-Commit-ID: 1snkiTnPGih
2018-04-20 17:53:37 +12:00
Emilio Cobos Álvarez
a22d605d3a Bug 1454238: Remove nsINode::eMEDIA. r=bz
MozReview-Commit-ID: LPutL6PlrgG
2018-04-20 01:30:12 +02:00
Brindusan Cristian
1bc6e7d860 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-04-17 13:09:40 +03: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
Nicholas Nethercote
e585e8ddb3 Bug 1448222 - Remove MediaPrefs. r=jya
This patch converts all the prefs in MediaPrefs to the new StaticPrefs system.

Note that the "media.wmf.skip-blacklist" pref was present in both MediaPrefs
and gfxPrefs. The copy in MediaPrefs was never used; this explains why this
patch does not add an entry for it to StaticPrefList.h.

Note also that the patch removes themedia.rust.mp4parser pref, because it's
unused.

MozReview-Commit-ID: IfHP37NbIjY
2018-03-20 09:48:56 +11:00
Boris Zbarsky
d18e4f5af5 Bug 1452741. Stop using the no-arg DOMEventTargetHelper constructor in MediaTrack. r=bkelly
MozReview-Commit-ID: AbE3XJdj4KO
2018-04-11 10:27:00 -04: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
Andreea Pavel
fa7ef642ca Merge mozilla-inbound to mozilla-central. a=merge 2018-04-06 13:20:21 +03: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
Alex Chronopoulos
1d4e155d80 Bug 1387454 - Create a MediaStreamGraph according to the given sample rate. r=padenot
MozReview-Commit-ID: 4YP8oWIVyjy
2018-04-03 20:02:15 +03:00
Boris Zbarsky
152cd3ba6e Bug 1447098 part 1. Rename FromContent on various DOM classes to FromNode. r=mystor
MozReview-Commit-ID: 202nkbmkwfR
2018-03-21 17:39:04 -04:00
Chris Pearce
d10ef7d9bd Bug 1445104 - Format HTMLMediaElement constructor with leading ',' instead of trailing. r=jya
MozReview-Commit-ID: DiRjKmtERGq
2018-03-13 13:41:46 +13: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
Videet
2c62d46dd7 Bug 547707: replaced hardcoded strings by definitions in nsMimeTypes.h r=gerald
MozReview-Commit-ID: 6f85pRUe8Tg
2018-03-06 17:43:57 +01:00
Emilio Cobos Álvarez
0ff849122a Bug 1442207: Remove unneeded arguments to nsIMutationObserver. r=smaug
aDocument is always content->OwnerDoc().
aContainer is always content->GetParent().

Differential Revision: https://phabricator.services.mozilla.com/D664

MozReview-Commit-ID: 4xwPCOnhyIL
2018-03-01 22:45:17 +01: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
Ben Kelly
d1e74e121d Bug 1440407 P2 Remove some unnecessary nsPIDOMWindowInner QI to nsIGlobalObject. r=mystor 2018-02-22 14:28:39 -08:00
Chris Pearce
452586fd3b Bug 1439473 - Improve logging of HTMLMediaElement JS API calls. r=kamidphish
To make it easier to tell what HTMLMediaElement API functions sites' JS is
calling, we should add more mozlogs. This will make it easier to figure out why
things aren't playing.

MozReview-Commit-ID: 9eVvkagGNgf
2018-02-15 16:39:44 +13:00
Csoregi Natalia
39c999114b Backed out changeset 2d7a7976ee3a (bug 1439473) for bustage HTMLMediaElement.cpp:4032. CLOSED TREE 2018-02-22 04:43:29 +02:00
Chris Pearce
35f6a976f6 Bug 1439473 - Improve logging of HTMLMediaElement JS API calls. r=kamidphish
To make it easier to tell what HTMLMediaElement API functions sites' JS is
calling, we should add more mozlogs. This will make it easier to figure out why
things aren't playing.

MozReview-Commit-ID: 9eVvkagGNgf
2018-02-15 16:39:44 +13:00
Adrian Wielgosik
5dd6662e27 Bug 1438956 - Modify HTMLMediaElement::Seek to avoid undefined behavior. r=bz
Previously, in IsInRanges, aIntervalIndex could have values between -1..length-1.
After the change, the values are in range 0..length, which makes it possible to use unsigned ints and avoid UB.

MozReview-Commit-ID: 39SIzXRHv91
2018-02-17 19:29:43 +01:00
Adrian Wielgosik
85e83416d3 Bug 1438956 - Add inline Start/End TimeRanges methods for C++ users. r=bz
MozReview-Commit-ID: DcLsYyKV7WX
2018-02-16 19:36:40 +01:00
Adrian Wielgosik
14167d9013 Bug 1438956 - Remove nsIDOMTimeRanges. r=bz
MozReview-Commit-ID: DAgQ0OkSxkq
2018-02-16 19:34:28 +01: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
Andreas Pehrson
c38486c12d Bug 1299515 - Plumb MediaStreamTrack enabled state to sources. r=jib
MozReview-Commit-ID: Eg1g9JtLmOz
2017-11-10 15:55:42 +01:00
Andrea Marchesini
3faaf5a84b Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug
* * *
Bug 1425458 - Resource timing entries Workers - part 10 - Correct parameters in NS_NewChannel in nsDataObj.cpp, r=me
2018-01-24 17:17:31 +01:00
Brindusan Cristian
1153f2c09e Backed out 12 changesets (bug 1425458) for mochitest failures on WorkerPrivate.cpp on a CLOSED TREE
Backed out changeset 11997de13778 (bug 1425458)
Backed out changeset 100b9d4f36bc (bug 1425458)
Backed out changeset a29e9dbb8c42 (bug 1425458)
Backed out changeset b96d58fd945c (bug 1425458)
Backed out changeset f140da44ba68 (bug 1425458)
Backed out changeset af56400233d9 (bug 1425458)
Backed out changeset 7034af4332e4 (bug 1425458)
Backed out changeset f70500179140 (bug 1425458)
Backed out changeset 793bbfc23257 (bug 1425458)
Backed out changeset 2efb375a8ffc (bug 1425458)
Backed out changeset 07e781e37451 (bug 1425458)
Backed out changeset e875f3702a5f (bug 1425458)
2018-01-24 20:47:48 +02:00
Andrea Marchesini
b434804b93 Bug 1425458 - Resource timing entries Workers - part 0 - NS_NewChannel, r=smaug 2018-01-24 17:17:31 +01:00
Chris Peterson
677bf4030c Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe
2017-11-05 19:37:28 -08:00
Honza Bambas
0691670da7 Bug 1391277 - Investigative logging in CSP: log when 'upgrade-insecure-requests' CSP is added to the CSP context, r=bz 2018-01-11 10:57:00 +02:00
Kilik Kuo
ba14257c35 Bug 1429284 - Expose compositor dropped frame count to HTMLMediaElement's debug info. r=jwwang
MozReview-Commit-ID: GYtHxdsGSk1
2018-01-10 12:07:47 +08: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
Gerald Squelart
39c2b02fa1 Bug 1407810 - Use DDLogger in media stack - r=jwwang
Mostly-mechanical additions:
- Log constructions&destructions, usually by just inheriting from
  DecoderDoctorLifeLogger, otherwise with explicit log commands (for internal
  classes for which DecoderDoctorTraits can't be specialized),
- Log links between most objects, e.g.: Media element -> decoder -> state
  machine -> reader -> demuxer -> resource, etc.

And logging some important properties and events (JS events, duration change,
frames being decoded, etc.)

More will be added later on, from just converting MOZ_LOGs, and as needed.

MozReview-Commit-ID: KgNhHSz35t0
2017-10-10 17:55:27 +11: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
JW Wang
f96c236ca3 Bug 1422677. P2 - remove the side effect of MediaDecoder::CanPlayThrough(). r=bechen,gerald
We calculate 'canplaythrough' in ChannelMediaDecoder::DownloadProgressed() and
send updates to MDSM.

MozReview-Commit-ID: KAeDciPAUKs
2017-12-01 14:34:58 +08:00
Andreas Pehrson
cd521a3dbc Bug 1419363 - Switch to WeakPtr. r=jib 2017-12-01 10:52:18 -05:00
Alastor Wu
ddc69c4c1a Bug 1415478 - part2 : allow autoplay for non-audible media content and video without audio content. r=jwwang
Per UX spec, we would allow non-audible media (volume 0, muted, video without audio track)
to autoplay.

MozReview-Commit-ID: HKUyt5Jt4sH
2017-11-30 10:50:21 +08: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