Now when using deferred switches in Player, it will track whether
to clear the buffer. This is needed because during startup,
StreamingEngine will append the first media segment; the old code
assumes that the buffer is empty. This is especially important for
text tracks which may only be one segment.
Change-Id: I03d97e2a674c8e713145dbc619b15d7c9402fb7f
Because we were using Function.apply to create strings, large arrays
were causing problems with browser argument count limits. This
now splits the arrays up before calling.
Closes#335
Change-Id: Ic94a950997e2f17563ecba8fb628f62c0ed18fc2
Now the application can restrict the kinds of tracks that the Player
will play. This is done through player.configure(). This also
allows restricting the playable tracks based on the EME key status.
Closes#326Closes#327
Change-Id: I88210ece6fd1db886c49d4599fbe5814d394132d
* Instead of using drift when looking up segment positions,
just fetch the segment before the one needed.
* Handle missing segments by polling instead of failing right away.
Closes#330
Change-Id: Ia7bb74d0120ee3ee965e351f87fc5f170ad585bd
Now there will be an error if the wrong keys are retrieved from the
license server. This can happen if the manifest is incorrect or if
the license server returns the wrong keys.
Closes#301
Change-Id: Id141cb74d02513f8e83205fd5d3242c887468d4e
Without @namespace annotations, static classes do not show up in the
generated API docs. Although I stumbled over one instance while
writing tutorials, the rest were discovered programmatically by:
for x in $(find lib/ -name '*.js'); do
grep -Eq '@(constructor|interface|namespace)' $x || echo $x
done
Change-Id: I97dd2bb4bf3faad5ac8d952a28837fa1f594deb9
This also changes DrmEngine to reject key systems that do not have
any license servers, this causes init() to fail.
Change-Id: I10148c2caa2ffc57bf6c5f16421ed0600d98be95
The receipt buffer mechanism allowed us use byte-based
eviction; however, it increased the complexity of StreamingEngine
and required us to make strict assumptions about the manifest.
With the receipt buffer gone, we will now do time-based eviction.
Applications can specify a maximum "buffer tail" length instead of a
maximum byte limit.
Change-Id: Iafdbe2e71516ea0ae18254b9767ecfc1d6813644
When the video element dispatches an error on MS and IE, there is
additional information that may be critical to diagnosing problems.
Change-Id: I5da621e414ea8c16a7240b2f64fb8555aef54588
Using goog.asserts will work with the compiler. So rather than
simply casting a nullable value when passing to a method, we can use
an assert which will correct the type and print a log if it somehow
is null.
This is not the same goog.asserts found in closure library, this
simply calls console.assert, but it is not required to do anything
for the compiler help.
Change-Id: I2548e39e772f0aa7ec41437cf9f5a2be383e0fbd
Before there were two style to indent comments after an annotation,
using 2 and 4 spaces. Now this only uses 2 spaces.
Change-Id: Id06415d7193cc154a2768fb3932aff7a06b7ed32
Instead of rejecting Promises with either exceptions or empty error
events, build full Error objects in MediaSourceEngine.
Change-Id: Ib4317f0ffe66c0292b3560f89f7a07e74e474dd3
Fixes the following issues:
=====
lib/player.js:106: ERROR - Property id never defined on TextTrack
lib/util/xml_utils.js:42: ERROR - inconsistent return type
found : (Node|null)
required: (Element|null)
lib/dash/content_protection.js:256: ERROR - Parameter must have JSDoc.
function(element) {
lib/dash/content_protection.js:284: ERROR - Parameter must have JSDoc.
function(elem) {
lib/media/drm_engine.js:47: ERROR - Private property configuration_ is never read
lib/polyfill/patchedmediakeys_20140218.js:269: ERROR - Private property keySystem_ is never read
lib/polyfill/patchedmediakeys_20140218.js:389: ERROR - Private property type_ is never read
lib/util/language_utils.js:84: ERROR - The value 0.0 is duplicated in this enum.
MIN: 0, MAX: 2
lib/util/language_utils.js:84: ERROR - The value 2.0 is duplicated in this enum.
MIN: 0, MAX: 2
demo/assets.js:171: ERROR - Value assigned to local variable headers is never read
lib/dash/content_protection.js:188: ERROR - Value assigned to local variable repUnknown is never read
lib/dash/dash_parser.js:400: ERROR - Value assigned to local variable suggestedDelay is never read
lib/dash/segment_base.js:41: ERROR - Value assigned to local variable SegmentBase is never read
lib/dash/segment_template.js:291: ERROR - Value assigned to local variable periodStart is never read
lib/media/drm_engine.js:172: ERROR - Value assigned to local variable onEncrypted is never read
test/dash_parser_live_unit.js:358: ERROR - Value assigned to local variable manifest is never read
test/drm_engine_unit.js:383: ERROR - Value assigned to local variable cert1 is never read
test/drm_engine_unit.js:384: ERROR - Value assigned to local variable cert2 is never read
test/media_source_engine_unit.js:24: ERROR - Value assigned to local variable dummyData is never read
test/media_source_engine_unit.js:504: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:505: ERROR - Value assigned to local variable p3 is never read
test/media_source_engine_unit.js:506: ERROR - Value assigned to local variable p4 is never read
test/media_source_engine_unit.js:535: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:601: ERROR - Value assigned to local variable p2 is never read
test/media_source_engine_unit.js:602: ERROR - Value assigned to local variable p3 is never read
test/media_source_engine_unit.js:603: ERROR - Value assigned to local variable p4 is never read
test/media_source_engine_unit.js:632: ERROR - Value assigned to local variable p2 is never read
test/mpd_utils_unit.js:20: ERROR - Value assigned to local variable HUGE_NUMBER_STRING is never read
test/streaming_engine_integration.js:55: ERROR - Value assigned to local variable onSeek is never read
test/streaming_engine_unit.js:1263: ERROR - Value assigned to local variable reportedContentType is never read
test/streaming_engine_unit.js:1264: ERROR - Value assigned to local variable reportedPeriodIndex is never read
test/streaming_engine_unit.js:1540: ERROR - Value assigned to local variable size is never read
test/util/dash_parser_util.js:77: ERROR - Value assigned to local variable retry is never read
test/util/dash_parser_util.js💯 ERROR - Value assigned to local variable retry is never read
test/vtt_text_parser_unit.js:272: ERROR - Value assigned to local variable result is never read
Change-Id: I707700250541e04ccbfe81d7298b3f0c5a82dcdc
We now avoid tricky things like CustomEvent and setting properties on
native Events. This gives us better cross-browser compatibility and
less complexity.
Change-Id: Idc9fcc69c33257e4540d956bcbc949de6d992cf0
Each category now has its own range of 1000 error codes. Using codes
in the thousands rather than the hundreds will help avoid confusion
between our error codes and HTTP error codes.
Change-Id: I8defd0ecbbbff7ef1b06e18419f29f16a85b2555
Before, we simply converted each byte from an ArrayBuffer into a
character; however, this is only valid for ASCII characters. This
changes it to fully support UTF-8 encoded network responses.
Change-Id: I9c49f29b09960501d345b98aa7af1bb711972abf
* Replace onBufferNewPeriod() with onChooseStreams().
* Remove newPeriod()
* When transitioning Periods, only call onChooseStreams(p) once
Period p has been setup.
* Refactor documentation.
Change-Id: Ic341dd018302bf46fdd071072e5facb0e0fccb3b
* Tidy up unit tests, and add more eviction tests and drift tests.
* Add integration tests.
* Handle end-of-stream and end-of-Period scenarios when segments
are not perfectly aligned to Period boundaries.
* Use segment receipts to determine which segment to buffer next.
* Handle drift with eviction and other drift corner cases.
* Handle additional errors and improve overall robustness.
Change-Id: Ib57a255cda7a6e8c5857eb82accc14697983b893
This fixes the ContentProtection parsing to support non-IOP-compliant
manifests. This enables the unit tests for it, as well as adding
several more.
b/26982075
Change-Id: I0da2dbaa24ea2a6acf657b97f0a2e2d24ee3a16d
This also changes from using Node types to using Element types. This
is more correct since the code only deals with XML elements and not
with other Node types (e.g. text content nodes).
Change-Id: I0e8c7bf2adc1800a494e575b16661e8c69a7deb0
Non-nullability on some types forces us to use casts everywhere, at
which point the compiler is just trusting us. So they might as well
be nullable and save us some typing.
Also, change HTMLVideoElement to the more general HTMLMediaElement.
Change-Id: Iaf111835bfbf230b99ad8cd7a7a06a6caffd16bc
Add extra info to util.Error in non-compiled builds so that we have
meaningful stack traces in test failures.
Change-Id: I351d2f65ef764947f8318372a47eeb6f014d7b16
* StreamingEngine now limits buffers to a specified byte limit
and evicts old segments as it appends new ones.
Change-Id: Id3e65bc45e782bf9d1214a6b52df0b92892606cb
This also cleans up compiler errors for:
- Things required but not used
- Things used but not required
- Write-only local variables
We are suppressing the 'unnecessaryCasts' error in specific places
where it is, in fact, necessary to convert between unrelated types
for polyfills and work-alikes.
Change-Id: I155c746116f95383ea0a9caf9239fadccd8601af
This error type will be used for all internal errors, and will rely
on numeric error codes which can be easily checked by the application.
This also changes PSSH parsing to throw on errors instead of retaining
partial data.
Issue #201
b/25306826
Change-Id: I19d23d99d4ee72cb31fe5f233bac57a3a9cfc283
This changes namespace exports to the more targetted exportDoc,
adds exports where they are needed and removes them where they are
not. Exporting of Uint8Array and String utils should be re-evaluated
later.
Change-Id: I9298e73a0a5ef026b6f2b1854488d2c359be10c1
This wraps all MediaSource and SourceBuffer operations in Promises
and synchronizes them.
b/25306817
Change-Id: I73483ba73427d309c4e09cb82ab6404a59e7a726