Commit Graph

163 Commits

Author SHA1 Message Date
Theodore Abshire 7941703c5a Fix(hls): Allow config to play video-only HLS.
If an HLS stream has no provided codec information in its manifest,
we previously defaulted to providing a best-guess video and audio
codec.  This, however, caused problems for video-only and audio-only
streams; Chrome does not like it if an audio codec is provided for
a stream with no audio at all, for example, and fails to append the
chunks.
This modifies the HLS parser to not provide a default video codec if
the 'disableVideo' config is set, and similarly to not provide a
default audio codec if 'disableAudio' is set.

Issue #2868

Change-Id: I7826fdb69f2e5290914ed2c0d1e109f9db94f80d
2020-09-26 06:04:00 +00:00
Michelle Zhuo 1e8f8bbf1f feat(LL-HLS): Set default streaming config for low latency
To enable low latency streaming, the configuration of
inaccurateManifestTolerance should be set to 0, and rebufferingGoal
should be set to less than 1 partial segment duration.
Instead of requiring developers to set three configurations, we
default inaccurateManifestTolerance to 0 and rebufferingGoal to 0.01
with low latency mode, unless speicfied.

Issue #1525

Change-Id: I538fa6d84ced26225fe9ebdf5213b370debfa22d
2020-09-17 18:56:58 +00:00
Theodore Abshire 509e7b046a fix(manifest): Fix embedded captions vanishing.
Previously, on manifest updates, embedded captions would vanish in
single-period live DASH streams.  The problem was based on the
specific point in the load order that we added dummy text streams
to indicate the presence of embedded captions.
This modifies the PlayerInterface for manifest parsers to add a
new method passed in, makeTextStreamsForClosedCaptions, which
must be called by manifest parsers for new video streams.
This also completes an unfinished feature, where new video streams
which add new closed captions would not get corresponding
text streams.

Closes #2811

Change-Id: Iee7499ec950b363cf6839765cc2bd2d01743467d
2020-08-26 15:05:40 -07:00
Joey Parrish 6f803bd176 docs: Add doc on Application-Level Redirects
This scheme came up recently while working with a partner on
integration with their streaming infrastructure.  This new doc will
clarify what an Application-Level Redirect is, how it works, and how
it can be supported with Shaka Player.

Change-Id: Ia532fa543c0efb98333c1a5a8ad5f2afbd7936fd
2020-08-20 17:28:47 +00:00
michellezhuo a534dca883 feat(LL-HLS): Add configuration comments for low latency mode
1. In low latency mode, the playback start time from live edge is about
3 times partial segment duration, 3s for example. The rebufferingGoal of
2s would result in infinite buffering.

2. In low latency mode, do not allow drift for seeking. Only seek with
the presentation time.

Change-Id: Iee92727bf17dab8b52fae070522a5a2ec1621ffc
2020-07-22 17:00:15 +00:00
Álvaro Velad Galván fac29133c2 Add AirPlay button to overflow menu (#2701)
feat(UI): Add AirPlay button to overflow menu.
2020-07-14 15:55:15 -07:00
ismena 5915f469bd docs: Update the way to change seek bar colors in the tutorial.
Issue #2708

Change-Id: I66982bc04c8e9358782e9a13b361b7803fe766dd
2020-07-09 11:08:39 -07:00
michellezhuo 5923388211 docs: Add native HLS playback in Safari in FAQ
Change-Id: Ibb8e96037521ea31546a8760220413592ba8d9a4
2020-07-09 16:52:57 +00:00
태재영 7ab9031248 docs: change promise then to await (#2693)
Closes #2544
2020-06-29 14:24:23 -07:00
태재영 dd48cef08f docs: change variable declaration to modern syntax (#2692)
Issue #2544
2020-06-29 14:06:25 -07:00
Theodore Abshire aa9fe1d049 fix(demo): Fix behavior when UI fails to load
This modifies the demo to load localizations even when the UI fails
to load, so that the footer links will still be visible.
This also makes the footer links work in that situation, and modifies
the shaka-ui-load-failed event to return a failure reason code, so
that we can display a contextual error message in event of a failure.

Closes #2669

Change-Id: I0cf38f7e39558f1977eee490131378c32105437f
2020-06-23 23:29:37 +00:00
Sandra Lokshina cda30283d2 Fix: fix UI not showing up for server side ad streams.
Apparently, IMA SDK adds their ad UI differently on SS vs
CS ad streams. The solution we devised for CS ad experience
that combined our UI with the IMA's native ad UI turned out
not to work for the SS experience - our UI was being obstructed
by the IMA's UI.
This change adds a new container for the SS IMA UI that allows
our own UI to stay visible.

Issue #2592.

Change-Id: Iedb24beeb8d6f777b1fd7f4155c591350432ec78
2020-06-12 16:55:33 +00:00
Theodore Abshire 44ba84e0b8 docs: Update Manifest Parser tutorial
This updates the Manifest Parser tutorial to match the new v3.0
manifest structure.

Closes #2634

Change-Id: I645f82624ae68193e80c28a7ec45c7a4316c7654
2020-06-09 22:30:18 +00:00
Joey Parrish 741424eef6 fix: Correct IMA SDK URLs in service worker and docs
The IMA SDK URLs in the service worker were http, and should have been
https.  This caused an issue when deploying v3.0.0 to appspot.

The IMA SDK URLs in the demo specified no protocol, but that is not
necessary, since https works in all contexts.

The IMA SDK URLs in the docs also specified no protocol, and one of
them was incorrect.

This corrects the mistaken URLs and makes them universally https.

Change-Id: I53dbf25ddb16ec882fcf3c070bcebed726277be1
2020-06-08 20:38:49 -07:00
Theodore Abshire e050a238f2 Updated and clarified docs on plugin interface.
Issue #2619

Change-Id: I953421ce580d37b382dca36017b221f94824f20a
2020-06-05 12:00:47 -07:00
Theodore Abshire 8d657140f1 Made ManifestParser.PlayerInterface.filter async.
This is a change in preparation for the adoption of the
MediaCapabilities API.

Related to #1391

Change-Id: If0988aedafe15aa3be794fb977fd8e04e91ca10e
2020-06-04 17:42:27 -07:00
Joey Parrish f8399ff0d2 Remove mention of now-dead SegmentIndex.replace()
The replace() method of SegmentIndex was only ever used in HlsParser,
and was never exported from v2.5.x.  We have decided at the last
minute to drop it before v3, so this change removes it from the
upgrade docs.

Change-Id: I0d89745dbeac14e1bf90e8e87f3401a797ea9792
2020-06-02 23:50:39 +00:00
Joey Parrish 5d2dc2daaf Update deprecation timelines (v3.1 => v4.0)
Since we are getting strict about semantic versioning, we can't remove
features in v3.1.  Any backward compatibility we offer will be
maintained until v4.0.

The exception is explicit IE 11 support, which will still be removed
in v3.1.

To help us follow the rules for removal, the Deprecate utility no
longer accepts a minor version argument.

Change-Id: I4dd94a6084e4ed72eeec410eb9aa0ad974d8dac8
2020-06-01 15:57:31 -07:00
Joey Parrish aba5e2583c Rename v2.6 to v3.0 and v2.7 to v3.1
We have decided to bump the major version number instead of the minor
number, based primarily on the fact that this release breaks
compatibility with our previous manifest structure.

Change-Id: I67e4c8267c6e103cfc7278e09daac186ae5cbbc6
2020-05-29 17:50:22 +00:00
Joey Parrish 82dc707579 Default cue size to 0, meaning "auto".
When no specific size has been set on a Cue object, the default will
now be 0, which means "auto" size to the text displayer.  If a cue has
no specific width, the background will fit to the text.  If a cue has
an explicit width of 100%, the background will fill the entire
horizontal space of the text container.

This fixes the 100%-width background introduced in Change-Id
I4500b8f637f3f43f48d019d14ef527e75d960fec in #2524.

Fixes #2524

Change-Id: I98caeb89d3da640a8175560810c8ccf2de27a2bb
2020-05-12 17:46:52 +00:00
Joey Parrish 200a0e2b95 Update the upgrade guides for v2.6
Change-Id: Ie024e7048b44f2f78b7fe359c083196f52747323
2020-05-11 09:56:40 -07:00
Joey Parrish a3f1c0220f Fix CEA caption extraction for b-frame content
This updates to mux.js 5.6.3, which includes a fix for v1 trun box
parsing to fix caption extraction for content with b-frames.

Closes #2395

Change-Id: I206ce26bb43e8187599e8ca7be2e718f4ea345c3
2020-05-07 14:01:26 -07:00
Joey Parrish 09d4f4eddd Update details in the offline tutorial
Since we added support for abortable and concurrent store()
operations, this tutorial has gotten slightly out of date.  This
updates those particular details.

Change-Id: I932073b04b100cb201ee6be4dad8d8dba3deff18
2020-05-02 14:56:05 +00:00
Joey Parrish 1076b78465 Unfork Closure base and update the compiler
The Closure Library's base.js, the Closure Compiler, and the Closure
deps-writer are all now loaded via NPM instead of commiting them
directly to the repo.  This also updates both the library and compiler
to the latest version: 20200406.

We still have a fork of the Closure Library's URI parser.  The latest
upstream version of that has too many dependencies on the rest of the
library to import directly from NPM.

Some internals of the build system have been refactored, and the
"complete" set of files in the build system now includes third_party.

Our forked URI parser does not pass lint checks yet, so the linter
does not run over third_party yet.

A couple of overly-severe sets of compiler checks have been disabled,
since even the latest Closure Library's base.js doesn't pass them.

The script-loader in load.js had to be updated for compatibility with
the new Closure Library.  If you don't return "true" now, Closure's
base.js will stop loading subsequent source files.

Some local externs that we had written are now available from the
compiler, so our local copies have been deleted.

A few type-related changes have been made as well, removing casts that
were necessary with the old compiler, but not necessary with the new
one.

Finally, this corrects some type issues in the tests using the new
"typeof" annotation from the compiler.  This allows us to type a
variable as a class defined elsewhere.  For example, after loading the
compiled library, we can reference compiledShaka.Player, which has the
type "typeof shaka.Player".  The compiler can then type-check all uses
of it in the tests.

Closes #2528 (bad polyfill code generated by the old compiler)

Change-Id: I62ec61e82d4edf342b2c576c2d4f89f11562ee65
2020-04-30 19:32:30 -07:00
Sandra Lokshina 8cb5001984 Replace our skip button with the IMA's default one.
According to the agreement with the IMA team, we will
no longer hide their UI during ads. Instead we will
incorporate their elements into our layout.
(Some of the elements they expose are legally required
or business critical for partners for certain types of
ads).
This change replaces our skip button with the IMA one
and tweaks our layout to make it fit better.
We are keeping our ad counter and the 'Ad X of Y'
element.
Our skip button will stay in the library, and we will
use it for other (non IMA) ad integrations.

Change-Id: I648c6c65a34607685a409a264c2a03d74cc4d461
2020-04-22 21:03:11 +00:00
Sandra Lokshina 943dfa756b Add a tutorial on serving ads.
Issue #1169.

Change-Id: Ibc3a987278374fba3422880ed4060bbb844e3729
2020-04-16 22:38:10 +00:00
Joey Parrish 42afedd1e4 Update to mux.js 5.5.4
This gets us a fix for a closed caption parsing issue described in
videojs/mux.js#330 and fixed in videojs/mux.js#333:

> Atypical streams containing 2+ SEI NAL payloads of type 0x04
> (CEA-708 caption content) in the sei_rbsp (specifically a DTG1
> payload preceding a GA94 payload) fail to display captions in this
> scenario, as the current logic results in parseSei() prematurely
> returning with the DTG1 payload.
>
> By checking for the user ID within parseSei, mux.js can continue
> iterating through the sei_rbsp for the GA94 payload.

Change-Id: I9d90419643279a1273187e0354b5e991cd609ba2
2020-04-14 10:26:39 -07:00
michellezhuo 734d129fcd Add Support for HLS Discontinuity
Closes #2397
Closes #1335

Change-Id: I6f540c42c72bf0ae36239b682d4016cca3981c0f
2020-04-09 14:59:42 -07:00
Joey Parrish e8ac57f36c Move drmInfos array to Stream
Period-flattening will concatenate Stream objects, so this information
should be available per-Stream instead of at the Variant level.

Issue #1339

Change-Id: I96195fea48cab1e4a349b2ab0b16064a443e928a
2020-04-09 19:22:16 +00:00
Joey Parrish 11cbb267c5 Fix broken docs for UI control events
The event namespaces were wrong, so the generated docs had broken
links.

Closes #2385

Change-Id: I9348dedc1a41edee127548e7f80c7e426ffd237e
2020-04-07 23:37:51 +00:00
Joey Parrish 1005f760dd Add FAQ entry about minBufferTime
Closes #2000

Change-Id: Ic336c681dea0169fe5e7c5ca62f08e3e1b926b25
2020-04-07 23:37:26 +00:00
Jacob Trimble 7ae6fc7d93 Fix FairPlay encrypted event handling.
The 'webkitkeyneeded' and 'encrypted' events send similar data, but
they were incompatible with each other and our transform handling.
This makes our polyfill produce the same format as the browser for
cases where the browser may only fire the old event.  This also makes
our utilities work with the new format.

The 'webkitkeyneeded' event was a length-prefixed UTF-16 string while
the 'encrypted' event was just a UTF-8 string.

This also makes a breaking change in the transform callback to pass the
init data type.  This shouldn't break anyone that only uses the first
argument; the second argument was mainly added so we could have the
default transform work without knowing anything.

This change could also break people who use custom transform functions.
The init data format is changing, which could break people who read
it directly.  If they follow the tutorial and use our utilities, it
shouldn't break.  This also updates the tutorial to match the new format
and be more clear about the format.

Fixes #2214

Change-Id: I006382028e828e31e20e085114fd7fd85c0e1eaa
2020-04-07 16:59:27 +00:00
Joey Parrish 1ab3f9c6db Remove position from SegmentReference
As part of Period-flattening, I'm trying to remove our dependence on
the "position" field of SegmentReference.  With that eliminated, we
can more easily concatenate Arrays of SegmentReferences without
modifying them.

 - Make SegmentIndex iterable
 - Add specialized seek() and current() methods to SegmentIterator
 - Remove position from SegmentReference
 - Make positions in SegmentIndex API stable without field in
   reference
 - Remove brittle hard-coded positions in tests (except SegmentIndex
   tests, where they would be hard to avoid in testing methods
   separately)
 - Use SegmentIterator in StreamingEngine to track the next segment
   between switches

Issue #892 (refactor StreamingEngine)
Issue #1339 (period flattening)

Change-Id: I666cc21249c34ee6cbc138a59109d9f1159fa127
2020-03-23 10:09:35 -07:00
Joey Parrish 7b80252408 Improved ClearKey Example (#2439)
Improving documentation for DRM-Configuration for ClearKey

Closes #2434
2020-03-04 10:26:07 -08:00
Joey Parrish b38b75c892 Fix truncated UI tutorial
Unescaped HTML tags in the tutorial text were placed directly in the
HTML output by jsdoc, causing the text to appear truncated.

Closes #2410

Change-Id: Ic7e3563cc000e666237851b1c7429a164532db6a
2020-02-21 00:47:12 +00:00
Brian Harris 10218b1342 Update offline.md (#2404)
https://developers.google.com/web/updates/2017/12/chrome-63-64-media-updates#persistent-licenses-windows-mac
2020-02-19 13:09:24 -08:00
michellezhuo cfe1f89171 Add playback speed selection to UI
Closes #2362
Closes #1676

Change-Id: I10184dccab301be7382940e35e36d66dc7a5e2ad
2020-02-12 20:24:03 +00:00
Sandra Lokshina eda5b72134 Add loop control element to the UI.
Please note that this CL doesn't add the new control
to the default layout, so it won't show up in our
demo page.

Issue #2362

Change-Id: Ibecf6a7174de7d8eca9049f0b46ae179a03b9c01
2020-02-04 21:27:20 +00:00
Theodore Abshire bcb4c56ecc Fix typo in fairplay tutorial.
Closes #2344

Change-Id: I8f3702820887e3f4a6158fbdaa01df032a5193e7
2020-01-16 13:47:25 -08:00
Joey Parrish 41a8664dba Make segment references independent of periods
This is a step along the way to flattening periods, and also
simplifies a few small things in StreamingEngine and tests.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: Ie17cd5e15ed6ec9290a918c3a69c05c74581e0fc
2020-01-02 19:03:18 +00:00
Joey Parrish c13830e535 Augment SegmentReference with offset and window
SegmentReference used to have presentationTimeOffset, which,
subtracted from the period start time, was then _added_ to the
timestamps in the segment by MediaSource.

Now, SegmentReference has a timestampOffset field, which is exactly
what MediaSource's timestampOffset field is set to on the SourceBuffer
before this segment is appended.  For DASH, this is periodStart minus
presentationTimeOffset.

This also adds append window start & end times to the
SegmentReference.  Now segments can be appended to SourceBuffers
without reference to the period.

Note that start & end times of the SegmentReference in each segment
index are still relative to the period.  This will change in a
follow-up.

Issue #1339 (flatten periods)
Issue #892 (refactor StreamingEngine)

Change-Id: I9d54eb2b529ec643c9475b8e9d218c3e2e826a26
2019-12-19 11:35:14 -08:00
Sandra Lokshina 151c06985a Add a FAQ about ad blockers.
Issue #2222.

Change-Id: I6af12a98bf976c19fdc69bbad9f4fdde69f84dc2
2019-12-03 21:52:00 +00:00
Sandra Lokshina 8d1ec9b460 Expand on how to customize the UI in the tutorial.
Apparently, the UI customization tutorial is a bit hard
for people to understand. This adds some more context
to the code examples.

Issue #2241.

Change-Id: I6218e4afb8293dfc1cc98e3677868f36f27cec09
2019-11-18 09:57:52 -08:00
Sandra Lokshina 827e5d813f Support setting source through HTML
Issue #2088.

Change-Id: Ib0ee45e4b5e6b0f6bcdd8b76f26ddd0cfa972a03
2019-08-28 18:34:51 +00:00
Sandra Lokshina 1cc3b9ff96 Add player and ui to window in UI tutorial.
Based on the recent CWIP feedback.

Closes #2112.

Change-Id: I157ba61ba1b6a9c9557fddeb2fd47dcde794e7db
2019-08-23 18:22:07 +00:00
Jacob Trimble c5b9d6804f Allow custom content ID in FairPlay.
Now there is a generic callback to transform the init data before
passing it to the browser.  This can be used by apps to use a custom
content ID in FairPlay content.  This also adds some utilities to help
in writing these functions and moves the default behavior to DrmEngine.

Closes #1951

Change-Id: I78ce660c126b53a69d5f55b16775ffcdbbe4d748
2019-08-07 18:38:40 +00:00
Jacob Trimble ad996d6873 Add tutorial for FairPlay support.
Closes #1951

Change-Id: I2dac43117ef444cf0701b2195d4a0e93385e5d52
2019-08-05 17:25:34 +00:00
Sandra Lokshina b4ddbd2131 Add mention of the Chromecast SDK to the UI tutorial.
Closes #2061.

Change-Id: I48396b8e5cd9ed821b25f5d87965ed7fd8e86691
2019-08-01 22:50:18 +00:00
Joey Parrish 7fe97b841b Move fields to SegmentReference
To prepare for flattening out the manifest structure to remove
periods, this change moves initSegmentReference and
presentationTimeOffset fields into the SegmentReference object.  This
way, the segments on either side of a period transition or HLS
discontinuity can have different offsets or init segments, eventually
allowing us to create a single array of SegmentReferences for
multi-period content.

Issue #1339

Change-Id: Ic7eff0483789644881247ecf8044c5fb6a48f0e6
2019-08-01 11:04:36 -07:00
Sandra Lokshina f33395eb83 Add the addBigPlayButton config to the tutorial.
Change-Id: Ief7c13490954539bf9784f1ecd3c7cc3d6b58e1b
2019-07-25 15:10:18 -07:00