In-band key rotation, in which new keys are signaled by a change in the
pssh in the media segments, is not working on the Xbox one, but is
working for other browsers and devices. It appear that the Xbox does not
continue watching for pssh changes after the initial DRM session has
been setup.
The problem is fixed by parsing the pssh from media segments prior to
appending to the source buffer. This behavior is controlled with the new
boolean config field drm.parseInbandPsshEnabled.
Fixes#4401
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
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
The PR to add support for pulling EME init data from the segments was
incorrect and had some bugs. This stops re-initializing DrmEngine since
this isn't needed and could cause problems with the offline licenses.
This also just uses the Pssh helper once to parse and extract the
init data. Lastly this throws the old error if we don't have any
sessions when we are done; if we try to store WebM content, we should
still throw if there is no init data in the manifest.
Issue #1531
Change-Id: Ie524abda993a076397e233008709f11a2e68a8f8
Now shaka.util.Pssh will only create a view on the buffer instead of
re-creating the PSSH boxes for each element. This also removes the
boundaries field since the data fields are the useful ones.
This also fixes a possible bug in BufferUtils, updates comments, and
adds some more tests for negative offsets.
Change-Id: Ibe1b7d61d5f5c7e52dfd7aa954db98f0592da4a5
These are intermittently used and cannot be verified. Most of our
methods can throw a shaka.util.Error, so having it doesn't really add
anything. Plus, if we change a function to throw, we'd need to update
all their callers to ensure they have an accurate description of what
they throw; otherwise we can't trust the directive.
Change-Id: I520bd0fc4c33443e967bf5b103ca5aa9e3274884
A new conformance rule was added after the PR was started and it is
violating it. This fixes the violation and adds another assertion.
Change-Id: Ie18760d9e1db1959d9587682ff6c9c8ca4fe6a8f
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
This reverts commit 6e5a0797de, #2042.
The PR as it landed broke some test cases and functionality for storing persistent licenses, and it doesn't seem to work even for its intended use case.
* fix: Reference issue with SegmentReference createUris
* test: Added Segment GetUris Test for timeline
* feat: Get PSSH from segements if not initdata exists
* feat: Get PSSH from segements if not initdata exists
* fix: JSDoc comments and moved drmEngine update to storage
* fix: Remove comments
* fix: Remove unused import
* fix: Lint erros and dedup initData code
* fix: remove no init data test and add check for use persistent license
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
The ParsedBox structure used by the Mp4Parser, previously, had
its property names changed in compiled mode.
This makes ParsedBox into an extern, so that it will be preserved
unchanged in compiled mode.
Closes#1522
Change-Id: I0964f8a4b9ccea57c61e2c587a776ed76cfbc8da
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
When defining a box, the box would be defined as a four
byte integer. Now there is a "fromString" function that
can be used to convert a four character assci string to
a four byte integer.
Change-Id: I78c704e012620c94ae681efb450977305bdb84aa
Before parsing Mp4Boxes was done using the "findBox" method. This
was limted to only looking at one level of the structure and
required a large amount of code to dig deeper into the structure.
This change creates a generalized Mp4 Box parser that should
simplify parsing Mp4Boxes. This will help work on #699.
Change-Id: Ie67ff30a6db890cae16fe02ae9c92bca711815a9
* Drop unnecessary type alternation in SegmentIndex unit tests
* Drop unnecessary bind in StreamingEngine unit tests
* Drop unnecessary expose annotations in Pssh
* Add comments about quoted access in cast unit tests
* Move afterAll() position in cast unit tests
* Make return type for PublicPromise constructor more specific
* Define a type for Util.eventLoop return value
Related to PR #421
Change-Id: I092a8ff366b4ac4ea868dd3f4fbe4e3d63a2167f
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
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.
Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb