This is an MP4 Parser which extracts CEA-708 packets from Fragmented MP4 streams.
The Closed Caption Parser (shaka.media.ClosedCaptionParser) will own this MP4 Parser, and will initialize it and call it as shown. As data comes in, the parser will parse this data, and the caption packets data then be returned in a callback (on708Data), as shown. Here, a theoretical decoder (future pull request, mentioned as a Todo comment) will decode and extract the parsed captions from these packets.
Issue #2648
There are some platforms (e.g. iPad) which can be rotated,
but do not support the screen.orientation API. This is relevant
because iPad now supports requestFullscreen, which it did not
before.
Found while investigating #2653
Change-Id: Iacc93433aa1fb50a25d968203dc9fd4f7f16b4ae
In player, SimpleTextDisplayer was set as the default TextDisplayer. In
our UI, it changes the configuration to use the UITextDisplayer, and
UITextDisplayer gets constructed with the player. Later in our demo, it
resets the config, so an extra SimpleTextDisplayer gets constructed.
This introduces an extra TextTrack created by SimpleTextDisplayer.
This change sets the UITextDisplayer as the default TextDisplayer in
player's default config.
Closes#2516
Change-Id: I3f653be9fad8b2edbc2fb9de84e8abb327dcfc51
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
This removes periods from the internal manifest structure and cleans
up code and tests accordingly. This leaves us unable to play
multi-period DASH & offline streams until the main period-flattening
algorithm is completed in shaka.util.Periods.
Three test cases have been disabled for the moment.
Multi-period playback will be restored in a smaller, more focused
follow-up commit, with disabled tests re-enabled.
Issue #1339 (flatten periods)
Issue #1698 (rapid period transitions issue)
Issue #856 (audio change causes bitrate change)
Closes#892 (refactor StreamingEngine)
Change-Id: I0cbf3b56bfdb51add15229df323b902f0b2e643a
This PR ads initial logic to enable support for IMA DAI streams.
Ad-containing streams can now be requested from the IMA stream manager and played.
Integration with the ad UI will follow in a separate CL.
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
This change adds an ad counter and a skip add
button to the DOM and styles them appropriately.
Please note that they don't work yet!
The elements are hidden for now.
To check them out, remove the 'shaka-hidden'
class from the 'shaka-ad-controls' div.
(data-shaka-player-container -> shaka-ad-controls-container ->
shaka-ad-controls).
Change-Id: I45a33d43abc6b0a023cc77f09abdae94a4cee014
This CL does:
- define CS IMA externs
- define Ad Insertion classes and sctructures
- add a (non-working) skeleton for the Ad UI
- provide a (working) early draft of the CS implementation
This CL does not:
- add any SS logic
- have a working ad UI
- provide a final and complete implementation for the CS logic
- fully follow the finalized Ad Insertion design
Change-Id: I645cdcb3a1d4041792b940c2d6faf011be5eb682
This extracts common code in our overflow menu settings
menus.
Text, Audio Language and Resolution selections now inherit
from this class. It also makes it easier to create new
overflow menu items.
Closes#2091
Change-Id: Ib68e1fb295ed3ec61cb7a072c039a5c7c4e22183
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
This factors out common functionality and structure from the volume
bar and seek bar, both of which involved specific CSS workarounds for
IE. The seek bar had logic to keep the value from jumping around
during casting, which now the volume bar benefits from, as well.
Finally, the seek bar code was spread out throughout controls.js, and
now it has its own class.
Closes#1913
Change-Id: I299476ccbc27f28f7b225a6e6f8b0d21abe5baf2
To prepare for an upcoming change to the format of the data stored in
IndexedDB, refactor the storage cells to remove common functionality.
This will make it easier to add a third cell type.
The format will change as we move fields in the manifest structure and
ultimately flatten out periods.
Issue #1339
Change-Id: Ibaeb35596180b2e2362b4d53734019599d6fff77
- Polyfill navigator.languages, which is missing on IE
- Add missing handler for uncaught exceptions (doesn't work on IE,
but is a good idea to have for debugging the demo app)
- Avoid offline setup if it's not supported (as on IE)
- Fix bad reference to uncompiled link (wrong ID)
- Log any caught errors to the console
- Wrap the init functions to catch and log any errors during init
Fixes b/131863587
Fixes#1911 (similar storage error on iOS)
Change-Id: Ib2a53392d5632c71825af17dd3e955cd54279e98
This adds a polyfill for Apple's prefixed EME implementation. This
will be used on all macOS versions prior to 10.14 (Mojave) and on
Safari versions prior to 12.1.
This also adds support for FairPlay license protocol eccentricities
in DrmEngine, so that the proper formatting is used for requests and
responses.
Issue #382
Change-Id: If1274d2f018a475f56c09df97645694f13acbde9
This change moves the trick play logic out of the video wrapper so that
it will be more available to the src= code. By doing this, I hope that
we can make it clearer how we are working with the playback rate and
ensure a tighter integration with it.
Issue #816
Issue #997
Change-Id: Id462cda2c5eb82c3713237341424b91891bd38ea
This changes the format of the localization data to enable apps to
trivially lazy-load translations. It also adds --locales to the build
scripts to allow app developers to choose the compiled-in locales.
The generated output now goes into dist/ and is not checked into
revision control. Finally, it adds "description" and "meaning" fields
to the source messages to allow us to more easily integrate with a
context-aware human translation service. The "description" field
provides application context for the translator, while the "meaning"
field provides linguistic disambiguation for words with multiple
meanings or parts of speech in the original English.
Because the translation service wants to collapse messages with
identical text, we had to merge several messages together. To this
end, we have removed the prefixes "ARIA_LABEL_" and "LABEL_" from the
messages themselves and collapsed what remained.
Issue #1688
Change-Id: I24c17e71c73f6663cf123cfdba118c486fa80ecc
Isolate the download estimation code out of DownloadManager so that it
can be tested in isolation and allow the code in DownloadManager to
focus on downloading.
Change-Id: I509adeaf50acb77bfaa9b2128f730de2653eda81
In four different places in our code base, we did the same
work to create a segment request. The bulk of the work was
based on setting-up the range header.
This CL creates a common utility that will create the request
for us while keeping networking engine as ignorant to segments
as it was before.
Issue #1788
Change-Id: Ie3dc2a99a34b3925fecbfdaae7b1e178a0b7a3b6
In our tests, it was possible for a timeout to fire after |clearTimeout|
was called. This CL makes sure that cannot happen by adding an "alive"
flag to each timeout.
To ensure that the change was as well defined as possible, this CL
changes how |shaka.util.Timer| is implemented and updates the API to
better communicate what is happening internally.
Change-Id: I57e3899046a762bff3293b9822a7e8f7ac804042
In order to support multiple different forms of loading, we have
designed a toolkit that we are calling "The Load Graph Toolkit". It
allows us to describe a series of work as a graph, and provides a way
for us to move through that graph, executing actions at each step.
This is the first step toward resolving #816, #997, and #1570. This
will provide the framework to build a more structured system for
loading and unloading content.
Issue #816
Issue #997
Issue #1570
Change-Id: I2f91089d07b0c901843550492308fcfd775bf161
Refactored |StreamUtils.getAllVariants| to get variants from a collection
of periods (rather than a manifest). This allows us to avoid needing to
assert that the manifest exists (when we know it will).
Looking long-term, as part of the refactor the method was moved to a
period-focused utility class. The goal of this is to make it easier to
see what methods may go away when we flatten periods.
Change-Id: I50aa97583892361ee4714a7beaf61e4cd95fb6b4
Before we had one central playhead observer that would monitor multiple
different relationships:
1. Buffering
2. Periods
3. Timeline Regions
This CL breaks each observer into their own class (allowing for them
to be tested independently). To allow the player to be ignorant of which
ones are in-use, a playhead observer manager has been created.
The player is responsible for creating the observers since it has the
knowledge of what ones need to be created (and the references to
everything).
As part of breaking the observers apart, the Region Timeline was broken
out so that the observer has something to observe (similar to how the
buffering observer observes the buffered region and the period observer
observes the periods).
Change-Id: I18bf0f45561f3bac44da50c0d00a02f8b1fbf3cf
We often use the IDestroyable interface to provide us with a standardized
way to break internal references and tear-down objects, however many
objects don't need this to be async. Once using IDestroyable, everyone
must assume that you must be async.
This change introduces IReleasable, a sibling to IDestryable, which
provides the |release| method. IReleasable is the synchronous version of
IDestroyable.
This change converts EventManager from IDestroyable to IReleasable as
the first of many conversions.
Change-Id: Ic3e90e594abc1c7326eccbe2521eb71676b74a09
While looking into a bug that involved stalling content, I found it
hard to keep the separation between stalls and gaps straight in the
code.
To help make it easier, I tried moving the stall code into its own
class (but used by the previously owning class).
During this change, an edge case was found, when paused for a while,
when we start playing again we see that as a stall. To avoid this,
we reset our stall duration so that once we start playing again, it
won't think it was stalled.
Change-Id: Ia6055e56e12ae4bc02063eeb6bbf6ffe472c2cb5
What's already done:
- UIElement and IUIElement interface
- All elements register themselves with controls
- Each element is responsible for its' behavior
- A bit of clean up with constants/enums moving to
their own files
What is not done yet:
- Overflow menu is a dumping ground now. Its'
elements will move to the UIElement model eventually, too.
- Build files are hacked a bit and will need more attention.
- No clean up has been done except for the constants/enums.
Change-Id: I9917aa705e85158a2f26830bd988552fe177e53b
This change defines a class to make it easier to track and return our
external stats record.
We have an external stats type used to communicate internal details about
what is happening during playback. The code for creating and updating the
stats was all in Player. With our src= work, only some of this data will
be trackable. To help, this change defines an internal stats class that
handles partial updates and then creates the external stats type when
requested.
This CL moves some complexity out of player, allowing the player to
focus on providing meaning while the Stat's object focuses on tracking
and storing it.
Change-Id: I8c19c98fde26c198566f33f6cbfead2826e39053
Define a set of tools that we can use to track, test, and communicate
features that are being deprecated.
When you want to communicate that a feature is now deprecated, you just
need to put:
```
shaka.Deprecate.enforce(MAJOR_VERSION_NUMBER,
MINOR_VERSION_NUMBER,
'Your message about what is being deprecated');
```
This will now print warnings when the feature is waiting to be removed and
print errors and fail asserts when the expiration has passed.
Change-Id: Ic66c53ecdfba7922cf961c7f588ab06beceb16ac
Define class that will be used by the deprecation system for handling
library versions. We are only going to support deprecating at a
minor-version number level. We are able to use this to our advantage
when implementing Version as it makes the code MUCH simpler.
Change-Id: I041bc8d7c20a277d84fb621479b3116e3751e319
To make it easier to know where we are check what platform something is
(normally a sign of a work-around), this change isolates the logic to
make the check into functions.
Now looking for uses of |shaka.util.Platform| should show when we are
using platform-specific logic.
Change-Id: Ief49837c503e951f7138ec08a83355fe1c46db88
Similar to Transmuxer, adding a Caption Parser class as a wrapper of
mux.js's Caption Parser, and move all relevant operations from Media
Source Engine to Caption Parser wrapper class.
Issue: #1404
Change-Id: Iaafa22a963b53315e1f7ae52a5fe17a4cd3f2bde