Change rules so we enforce ["foo", "bar"] rather than [ "foo", "bar" ].
MozReview-Commit-ID: KX6wJd8jmeJ
--HG--
extra : rebase_source : 6800cf4e701a33f246418e0deb35a206af8104f4
When using a media element with a Media Source, the resource fetching algorithm is to be called in "local" mode:
https://www.w3.org/TR/media-source/#mediasource-attach
"Continue the resource fetch algorithm by running the remaining "Otherwise (mode is local)" steps, with these clarifications"
https://html.spec.whatwg.org/multipage/media.html#concept-media-load-resource
Under the local mode, the steps that would cause the element to fire suspend, stalled or progress can never occur.
We only prevent the stalled event to be fired, many websites rely on the progress event to be fired (such as when the init segment has been parsed). The HTML5 media spec will be amended to clearly indicate that progress is to be fired even with mediasource
MozReview-Commit-ID: DkoQzoV0JzO
--HG--
extra : rebase_source : 1e916eee50c9935f168797bb5a92052191cda59d
Add .eslintrc.js to configure globals from mediasource.js and to add extra
rules to encourage use of let and const over var.
Linting changes:
- Prefer const and let to var. This provides tighter scoping and avoids
reassignment.
- Mozilla rules do not allow for shadowing of variables, so several tests have
had promise lists renamed to avoid this.
- Numerous minor fixes to formatting including using double quotes, spacing,
missing semicolons.
- Remove some unused variables.
- Arrays have spaces after opening braces and before closing braces, e.g.
[ "foo" ], this is to be consistent with our clang-format rules.
- Fix naming of resourcePathSeen in test_MediaSource_memory_reporting.html.
MozReview-Commit-ID: 5q6oS7EWLTk
--HG--
extra : rebase_source : 9b67b294f338ca9205b52fded3af63e6c3ac9a5a
This patch does two things,
(1) check v.seekable after calling ms.endOfStream()
As test name suggests, we check seekable after calling endOfStream()
(2) check the time range of v.seekable
The seekable represents the ranges of the media resource [1], so it would be changed after calling ms.endOfStream().
Before calling the endOfStream(), seekable should be [0, ms.duration)
After calling the endOfStream(), seekable should be [0, ms.buffer.end(0))
[1] https://www.w3.org/TR/html51/semantics-embedded-content.html#dom-htmlmediaelement-seekable
MozReview-Commit-ID: 56AIZYVsHhW
--HG--
extra : rebase_source : a1f1df601dc8523cd5d4e58b41cada3c79d494c1
Fix the fail by patch1, so we can re-enable it.
MozReview-Commit-ID: It3JkvQzAdk
--HG--
extra : rebase_source : 5ad433012750c8f6c92b16b787e87b32ee03d7a6
Similar to test_PlayEventsAutoPlaying.html, but here we load 10s of data and ensure autoplaying kicks in.
MozReview-Commit-ID: ImpjFIcBIo1
--HG--
extra : rebase_source : c7d280eebeb6b3398176423b9e723696c9543c7f
I'm not sure what this mochitest was supposed to test, but it was doing it wrong anyway.
MozReview-Commit-ID: BexSN7YgXwj
--HG--
extra : rebase_source : ee056ab1eede9381376265dffb2f171cec87b086
Per spec loadedmetadata should be fired before updateend. fetchAndLoad want on the updateend event. So we can't wait for the loadedmetadata event only after updateend has been fired.
MozReview-Commit-ID: BprzynZ8t1U
--HG--
extra : rebase_source : e3281b2d68272f5dd08567bfd3189e75411a6a99
It was incorrect to assume that once "loadeddata" event fired the sourcebuffer would be usable again. Only the "updateend" event guarantees such condition.
MozReview-Commit-ID: HcyaLWjjBlp
--HG--
extra : rebase_source : c9d7a91ecc40c633078eaa2dec635e240106dff6
The stalled event can be fired as playback is starting and data has yet to be processed.
So instead we wait for playback to reach the end.
MozReview-Commit-ID: 4W3M5tee2HD
--HG--
extra : rebase_source : 349321452f8e1cc3307e8cedb6ebf44949694661
When endOfStream() is called, the duration is changed to that of the last buffered frame's end time.
The ended event will only be fired if currentTime is equal to the duration. So if the duration has changed following a call to endOfStream, then playback won't be considered as ended.
MozReview-Commit-ID: DBu3LorwFTI
--HG--
extra : rebase_source : a721ac0186f609b23537b71819c63d812f89a3b6
We have no need to call endOfStream here as we don't rely on the ended event being fired.
Also, there's no need to track how many update count we will get when we only use appendBuffer once.
Adding extra test to help identify where the actual failure of the test could occur.
MozReview-Commit-ID: HIu1XQpHark
--HG--
extra : rebase_source : 07f9ac856d290f1347ec4b33794dc7d20adcc4cc
Assuming that the buffered range has been updated when loadedmetadata was fired was wrong. Only once the data has been fully appended to the source buffer, can seeking complete.
MozReview-Commit-ID: LRY0PRaMEw9
--HG--
extra : rebase_source : 07dcae199c8c38e3cadc3c4ed302e4bd3a82b48b
Add an AVC3 (content provided by BBC) mochitest. We've regressed BBC playback rather regularly. Better make sure this never happens again.
MozReview-Commit-ID: 5ssaLcqiqsv
--HG--
extra : rebase_source : 27938e746822f89167f287d57c81f276198b2c5e
Note the race is uncovered by P1 which kinda change the order of events.
MozReview-Commit-ID: 3INYvJVUhSG
--HG--
extra : rebase_source : e378c2a437a5a729008d39570be2a9087a7eb5f7
extra : intermediate-source : 02e2ecfea068dd9f487791287064e684a15dd599
extra : source : f2f40c70a2304e3e499422f3a7c46b59b54ad1ae
This patch is generated by the following sed script:
find . ! -wholename '*/.hg*' -type f \( -iname '*.html' -o -iname '*.xhtml' -o -iname '*.xul' -o -iname '*.js' \) -exec sed -i -e 's/\(\(text\|application\)\/javascript\);version=1.[0-9]/\1/g' {} \;
MozReview-Commit-ID: AzhtdwJwVNg
--HG--
extra : rebase_source : e8f90249454c0779d926f87777f457352961748d