This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.
It seems that the `!` in the header forces the compiler to keep it in
the output. I believe older compiler releases did this purely based
on `@license`.
Issue #2638
Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
Also add a note to the MSE polyfill about restrictions being applied
in Player as well. We used to restrict Safari versions only in the
polyfill, and I had forgotten about the other version check.
Closes#2548
Change-Id: I4d2f319939c3a079e7f0ec7134876d91fc425bf4
Because we have some polyfills and blacklists that are specific to
Safari and iOS, we need to detect specific versions of Safari and iOS.
The existing detection of Safari/iOS versions was in multiple places,
and did not account for non-Safari browsers on iOS. This refactor
allows us to correctly detect iOS Chrome, and fixes a fatal exception
thrown in the MediaSource polyfill for all non-Safari browsers on iOS.
Change-Id: Ic88dc1a4c82087054cd4791dbf295b7ea2aeab09
This changes the eslint rule to enforce a strict pattern for the
argument comments. The comment must appear before the argument and
must be /* foo= */. This still ignores line comments.
Change-Id: I3afb01c65e1088eda13facb3aeeaa7595a2f5aee
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.
This also updates the company name from "Google, Inc" to "Google LLC".
Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
Safari 13 is out, and needs polyfills just like Safari 12 did
(although one fewer). This assumes that Safari 13+ all need the same
polyfills (to avoid surprise failures when Safari 14 comes out).
This also raises the minimum version from Safari 9 to Safari 11, since
usage stats for Safari 9 and 10 are vanishingly small. Dropping
support for Safari 9 and 10 allows us to delete a complicated polyfill
used for those versions.
Change-Id: I8f833d915215fc19a89e3aea292b67c5d677c779
The Chromecast MediaSource polyfill was broken in "Avoid integer for
loops", Change-Id: I3ba3cb6a439264e823022b2a64e7cdbd265494c7.
This particular loop used to start at index 1, and the previous change
made it start at 0. Because of a test infrastructure failure that
prevented testing on Chromecast, we missed this mistake.
This bug did not affect any release versions.
This fixes the bug by using shift() to remove the first item before
the loop, instead of [0] to access it in-place.
Change-Id: I3aa53436e23a1b389375df2b06b3bbbab18ecf0b
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.
Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
This is an automated change to convert use of "function" functions
to arrow functions. This doesn't change all uses of bind() that
could be converted. This also doesn't remove all "function" functions.
Change-Id: I40ac7d086bcef947a1be083359c8fd1d4499a9c3
A coming update to the Google eslint config will require using "const"
over "let". This makes that one change to isolate the big changes.
Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
Instead of triggering src= based on 'video/mp4' MIME types, ask the
browser what it can support using video.canPlayType().
Querying canPlayType() also allows us to detect src= support for
native HLS in Safari.
The original version of this change also added a complete fallback
system to detect MIME types based on common file extensions and
fetch MIME types via HEAD request when necessary, but the load graph
system does not yet allow us to make async decisions about destination
node. So this async MIME detection is commented out for now.
Closes#816 (src= single file playback)
Issue #997 (native HLS in Safari)
Change-Id: If1930ca4fd5710481a925d63fb312d9a5b15fec8
This CL creates the "loaded with src=" node and its initial
implementation. Adding this node required some changed to the routing
logic as a new destination was created.
We will use src= when given mp4 content or media source is unavailable.
We detect mp4 content via the mimeType in |load| and/or the file
extension. When media source is not available on a platform, we fall
back to using src=. To do this, we check if media source is available
whenever |load| is called, and will route to the src= branch if media
source is not found.
To avoid pre-initializing media source (when it is not available) we
modify the |initializeMediaSource| flag in |attach| and |unload| when
media source is not available.
Doing this showed that we had inconsistent behaviour between |attach|
and |unload|. |attach| would default to initializing media source
whereas |unload| would not. This has been fixed.
Issue #816
Issue #997
Change-Id: I00599832b49c9079e273e65a4b827fee736479cc
- Fix the link to Dolby's Dolby Vision Profiles and levels PDF
- Was pointing to a document version that no longer exists
- Update Dolby Vision regex to match all DV codecs
- Dolby Vision is available in 4 different (base) codecs: dvhe, dvh1, dvav, dva1
- dvh* represents HEVC-based Dolby Vision
- dva* represents AVC-based Dolby Vision.
- Do not remove Dolby Vision codecs on Chromecast
No need to remove Dolby Vision codecs on Chromecast. Chromecast's canDisplayType will reject them when the cast receiver or the attached display can't play Dolby Vision.
On Dolby Vision capable cast receivers attached to a TV in Dolby Vision mode, canDisplayType does not reject Dolby Vision streams. One such device is the Chromecast Ultra. With this change, Shaka Player plays Dolby Vision on qualifying setups.
Tizen Smart TVs do not play opus content well when using MSE. To prevent
Shaka Player from trying to play opus content on Tizen, we override
media source's isTypeSupported to reject opus content.
Since most content will have AAC as a fallback, this should not limit
playback on Tizen.
Issue #1751
Change-Id: Ia61a1d26f547082fa68a9f38e4af16951191dd4f
Now that we have Safari 12 in the lab, we have found that it requires
the same MediaSource polyfills as Safari 11.
Fixes b/120434307
Change-Id: I45f8be79d0aca7987ffcba1ce13b8589a2287712
This replaces almost every instance of indexOf on both String and
Array. There are very few places where we really wanted an index.
Mostly, indexOf was used to check for inclusion.
Change-Id: I08e299768b6ffdb4bfc30b39b5d82a058c6d1b56
https://goo.gl is being turned-down, so we can't use it for new URLS.
So we have consistent short links, this converts them to be
https://bit.ly.
Change-Id: I07a86cba807b67157664893341f648023918d0de
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.
This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.
Change-Id: I2bfa4d531a8fcdcf9578e9c181c4534ad7443b7a
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I6a329d28e13a81c9f7136737518c6bb8fa18402e
SourceBuffer.remove, when told to remove exactly up to a keyframe,
will also remove that keyframe and all of the content till the next
keyframe. This results in far too much content being deleted, and is
breaking our tests on Safari 11.
Patching this by offseting the end of the removal range by 1ms seems
to be a viable workaround.
Closes#1048
Change-Id: I062b2dc2617f1372f885f4ccbc906d77c65412d7
Because Safari's support for TS via MSE is broken, reject all TS
content in Safari. Transmuxing (#887) will compensate.
https://bugs.webkit.org/show_bug.cgi?id=165342Closes#743
Change-Id: Iff8a6a7c159e48a4f388d99396915752e649c6ac
There are several issues with isTypeSupported on Chromecast that
require workarounds in JavaScript:
- Dolby Vision strings must be removed from the codecs parameter,
even though the content is supported by the platform
- HDR must be guessed at from the codecs parameter and an additional
parameter must be added to query HDR support
- Queries must be made through a non-standard interface
Change-Id: I4c8c70e70cf9c26283913783f5f62f7d6470c2f1
This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
Safari 10 has some new MediaSource implementation bugs that need to
be worked around. This updates and refactors the polyfills for Safari
10.
Bugs filed:
https://goo.gl/qCeTZrhttps://goo.gl/rC3CLjCloses#615
Change-Id: Id694798cd083878f337c0ba6e017fcdaac3c69be
This adds a polyfill for a Safari 9 MediaSource bug where calling
abort() on SourceBuffer causes the decoder to fail.
The reason we call abort() at all is to reset the decoder and smooth
segment transitions on Chrome, Firefox, and Opera. Safari does not
seem to have this problem in the first place, so it is fine to
completely stub out abort().
Issue #446
Change-Id: Icbaaa3e9ce5372efdee937ddc4cf94a27dce6a47