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
Uses location to determine what the scheme should be if unspecified.
This is important because it allows us to use URIs that work for
either HTTP or HTTPS hosted apps without mixed content warnings.
Some special sauce was needed to make it testable, since we generally
can't mock location in tests.
Change-Id: I294ac532f1bba80977597e11addd7f585d1e9b79
Add extra info to util.Error in non-compiled builds so that we have
meaningful stack traces in test failures.
Change-Id: I351d2f65ef764947f8318372a47eeb6f014d7b16
This fails on Chrome:
var fn = Promise.resolve;
fn();
But this does not:
var fn = Promise.resolve.bind(Promise);
fn();
It seems that the native implementation of function "Promise.resolve"
needs the context of "Promise" as "this" to execute.
Change-Id: I4e06e6a85f966ef0af2f630da50cbfc60f12ed50
Nullable callbacks can't be handled generically, since types won't
match the template. typeof(null) != typeof(function(){})
- Make customScheme non-nullable.
- Check number of parameters in callbacks.
- Add a test that covers customScheme setting and validation.
Change-Id: I58eb88fc667bfa8ab13a679f1b1eed0c894e3755
DASH sec. 5.8.5.2 states that with the mp4protection scheme, the
@value attribute should be the scheme type. Rather than verify
the value is correct and ignore it anyway, this simply ignores it
entirely.
Change-Id: Ic1d089aecc1b5444b05cc5021606d9318e727a3a
This fixes small incompatibilities for IE11:
- XML parser sometimes fails by throwing rather than returning null
- bug in Promise polyfill prevented use of Promise.all([null, p])
- IE11 does not have ArrayBuffer.prototype.slice, used by integration
tests to clone a buffer in StreamGenerator
Change-Id: I9ace6bd17cd60272f85ce388342ca456f14d04c9
* StreamingEngine now limits buffers to a specified byte limit
and evicts old segments as it appends new ones.
Change-Id: Id3e65bc45e782bf9d1214a6b52df0b92892606cb
The optional arguments in this convenience function really only help
in the tests. To avoid some component in the library accidentally
making a request with default retry parameters instead of those
configured by the user, I'm making the retry parameters required.
The optional argument for method is only used once. To avoid the
temptation to add more positional arguments for other seldom-used
fields, I'm dropping the method argument completely.
Change-Id: Ib0afb5766f68c5505f11372e3b004fc8eaca1223
This adds some utility functions to NetworkingEngine for common
actions. This also cleans up the related unit tests.
Change-Id: I1105b77b6dac3637d566c1a4e2f77004ad705e8b
This removed any goog.require from the test code to make it simpler.
Now, shaka-player.uncompiled is required to be loaded before any
tests. This fixes some dependency problems.
This also moves the utility test code to test/util.
Change-Id: I8991a61fc59c9c03e0143bb0883fd6d166af86c2
This makes it possible for the few parts of the code which will use
headers to do so without relying on assumptions about case.
Change-Id: I3b1ca57a3d789d18d51b4ee94f0791daf301993f
A prelude to a more complete DrmEngine. Should allow development of
DRM-related DASH parsing to proceed in parallel with DrmEngine
development.
Change-Id: Ie51504955f530898469fcacd897cb51588caa7d4
When possible, use xhr.responseURL to detect 302 redirects and make
the information available in the Response object.
Use redirect URI as BaseURL for manifest parsing.
See also #225, #266
Change-Id: Ie24abeb3b8418b3e89fed6666eb525aecd74f03b
This makes sure that remove() is called in a way that is compatible
with IE11. For more information, see #251.
Change-Id: Iabe752713ba74c7bf516b4e7b93bc83cfccdd481
This is important to avoid renaming properties during compilation so
that applications can inject these types without compiling their code.
This also migrates record typedefs to the new documentation format.
Each record will be annotated with 'property' for each field in the
record. This results in better output from jsdoc.
Change-Id: Ia877b1e2b333ef7020a85f16bc2469a20879bf94
We will be transitioning toward a new way of documenting record
typedefs. Each record will be annotated with 'property' for each
field in the record. This results in better output from jsdoc.
This covers all internal record types. External records will be
handled in a separate CL.
Change-Id: I2ab93015bfc9db01b4b6d474b608709c99fd70cd
* Move redesign docs to docs/design/
* Put all build output (including closure deps) in dist/
* Restore doc-building scripts
* Fix small doc error in MPD utils
Change-Id: I930f4f976370885b3c3c37c59f1ae7fcc5522413
Renamed variables to only use URI instead of URL. Also made variable
names plural when referring to an array of choices.
Change-Id: I7bfd5022606d77a3153575d8f13dd1e040331901
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
Support testing is hierarchical. Player.support returns an object
mapping out the support present in various parts of the system.
This creates a shell for Player and DrmEngine, and introduces support
tests for MediaSourceEngine, ManifestParser, and DrmEngine.
This also adjusts the way support checks are done for text types, to
allow for expansion into MP4-embedded text types and other segmented
subtitle types.
Text changes related to #150 and #146
Change-Id: I707f01ba52cba6262ee89bee2c1f28d24aca4655
This will allow support-testing to work on older browsers so that
application developers can still load the library and query for
support to show an appropriate error message.
To accomplish this, we avoid load-time uses of Function.bind, avoid
certain polyfills if modern types are not available, and compile down
to ES3 to avoid errors caused by use of the reserved word "catch" on
Promises.
This has been tested back to IE6, Safari 5.1, iOS 6.0, Firefox 6,
Chrome 15, and Opera 16.
Change-Id: I9deed106a7736758e04452ef85bae40f37c6fe62
Installation of the Promise polyfill was incomplete in compiled mode,
since static methods were not attached to the constructor by the
compiler.
Cherry-picked from v1.6.1.
Change-Id: I304662dfdb88d2fb76fc8c06a23fc6fae2f5b1f1
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
* No longer uses FailoverUri.
* Uses string URIs directly.
* WebM now gets the last segment's duration.
Change-Id: I1b17f95c4f3fed4bf7e46964687670860240cc2b