Now the EbmlParser and DataViewReader types can accept BufferSource
objects to avoid the caller having to convert it at each callsite.
Change-Id: I527fbc638485214bfe976d7da89b79b6098033a8
This changes the network API to use BufferSource instead of ArrayBuffer,
which allows plugins to return a "view" on a buffer instead of the
whole buffer. This also adds some utilities for changing between
views and buffers.
Lastly this forbids the use of the "buffer" property of TypedArrays
since it doesn't work with partial "views". This audits and fixes the
usages of the "buffer" property to ensure correct usage.
It should be noted that both MSE and EME accept a BufferSource as input,
so we don't need to convert a "view" into an ArrayBuffer before passing
to it.
Change-Id: Iaa417773f8ce5304424e43c7372ce10ebf540d2a
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 enables the eslint rule that requires all functions to consistently
either return a value or not return a value.
Change-Id: I98b579f3689c3b6c74968116824231bb792bd9dd
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
This is only some of the warnings produced. These were not errors,
but we should fix them anyway so that we can adopt stricter settings
in future.
Change-Id: Ifd12f0e7c69f8f4b3d0d78b11794da2569a06d77
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: I225f5c7e54adf4cca8512cddae082ba50ed82e4e
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: I10f5c38a8b06b5797c6eec7492829084114514c9
A follow-up fix changes all 'var' definitions to 'let'. This fixes
issues caused by it. One major change is adding brackets to case
statements. Each case statement is considered in the same scope, so
defining variables in them actually are the same variable. By adding
brackes to the cases, each case gets its own scope.
Change-Id: I99b1298223786f4df415594a2e64eb31d72b2053
This converts from using ArrayBuffer in the text parsers to using
Uint8Array. This avoids doing extra buffer copies when using
ArrayBuffer.slice().
Closes#1022
Change-Id: I34a789ec4eb76c95169ba81f27a8433ef25f27f0
ArrayBuffer.slice isn't supported with two arguments on Tizen 2016.
This is a temporary fix that can be cherry-picked to v2.2. A better
fix will be handled in a follow-up change.
Issue #1022
Change-Id: Iae6a0b2ef0cf17843f42f22f0ea0962a56e8be68
See also commit 7a770783.
This fixes exports and externs that were broken in v2.1.0 and v2.1.1.
Generated externs are now verified and working with an external
Closure project.
Change-Id: I73a6b92474c87fd6119592c6d632ce91045fc073
DataViewReader is referenced in the exported class Mp4Parser, so it
must be exported as well. This fixes broken exports and externs in
v2.1.0 and v2.1.1.
Change-Id: If94e623d36694dd528495f654bbb8f27d0b113ba
This adds a severity field to Error objects. This can be used to
detect whether an error is recoverable. All the same errors are still
reported so the field can be ignored.
There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
load() again
Closes#564
Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
In many places we tried to guess the encoding of a piece of text.
This guess fails for Chinese UTF-8 text, and probably text in many
other languages.
However, DASH manifests, TTML files, WebVTT files, and VTTC box
payloads are all specified to be in UTF-8. Rather than guess and
possibly fail, treat all text in these contexts as UTF-8.
Change-Id: I00c652a9f1dd20855e94abfac84275e41dd9e266
Look for EMSG boxes in segments if the manifest signals their presence.
Update the manifest when a DASH EMSG box is encountered.
Dispatch an event with the content of the box for all other EMSG boxes.
Closes#259
Change-Id: I874121207c2419e756980ac858fba0d56e68e07e
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
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
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.
This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.
Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.
The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.
We can re-examine this once we have restructured the license headers.
Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
Includes unit tests and covers zero-sized PSSHs, truncated PSSHs, and
various orderings of both v0 and v1 PSSHs.
Change-Id: I79ecc9475d483be610c003b57e831954a1c9800b