Commit Graph

2275 Commits

Author SHA1 Message Date
Joey Parrish 1a3786b5d7 Add "kind" property for text streams
Issue #206

Change-Id: Id731da4b2d76a8fd62e316317600cae094c5255c
2015-12-03 16:32:56 -08:00
Jacob Trimble 9701e184e5 Imported WebM and MP4 index parsers from master branch.
These will not work as-is because FailoverUri is removed.  I will
update them in another change.

Change-Id: If8951f6499c13f83f33d5c7a14d86038793a11e1
2015-12-03 14:29:27 -08:00
Joey Parrish fff5dd7ee7 Audit exports
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
2015-12-01 13:56:37 -08:00
Joey Parrish cf53eda1f5 MediaSourceEngine integration tests
Change-Id: I9dea53285a18def6b6284ec9262e46b2d2b48b73
2015-12-01 21:52:51 +00:00
Timothy Drews f741ad6e3f Add MpdUtils.
Change-Id: Idbbeb7ed2d0534f148873e0a98dce0c0a4ac955f
2015-12-01 21:36:33 +00:00
Jacob Trimble 4a2ae58746 Imported LanguageUtils from master branch.
Change-Id: Ib4735529008c9c933102e48fd632fc205d7bf9e6
2015-12-01 01:04:11 +00:00
Timothy Drews 3b8563ee65 Add Manifest class and its dependences.
Change-Id: I65be31c74659ececa5d7b584c907642ee0466cc3
2015-11-30 17:01:23 -08:00
Joey Parrish db45f2c9fb Add comments to MediaSourceEngine's popFromQueue_
This is meant to resolve confusion about what popFromQueue_ does.
https://github.com/google/shaka-player/commit/a79cde2f#commitcomment-14687716

Change-Id: I21c99d2186913e464ed02000568bd4c2bd106e8e
2015-11-30 09:34:06 -08:00
Jacob Trimble 72cd63fc2b Added WebVTT text parser.
b/25325209

Change-Id: I1f3f267a27d758d0cbe8a0ef91811d422d4f0193
2015-11-25 12:14:05 -08:00
Timothy Drews 52e241ddbc Add SegmentIndex and SegmentReference.
Change-Id: I433b5251b25715e0461282e9fe287980ead5900d
2015-11-25 12:14:05 -08:00
Joey Parrish c68ef2f8f7 Fix NetworkingEngine.destroy() behavior
Previously, destroy() would reject as soon as any in-progress request
failed.  Now, destroy() waits for all requests to end regardless of
their ultimate state.

Also adds tests to cover destroy() behavior and drops unused test
util code from 1.x.  Line coverage for NetworkingEngine is now 100%.

Change-Id: I0e39e494d8f28c6dc595725a46094d10e3a58e93
2015-11-25 12:14:05 -08:00
Jacob Trimble 24eaf05fbc Added network plugin for HTTP and data URIs.
b/25296248

Change-Id: Iaea524f00e2297e151dc2fe93243083ce8b9949d
2015-11-25 12:14:05 -08:00
Jacob Trimble 667aee63ae Added URI argument to NetworkingEngine plugin.
b/25296248

Change-Id: I66ecb7aed9baf53cbafda3be9550dd03908226ce
2015-11-25 12:14:05 -08:00
Jacob Trimble ab127e6a04 Added NetworkingEngine.
b/25296248

Change-Id: I5cb64d47dd47624715a691a12243696932f2d5dd
2015-11-25 12:14:05 -08:00
Joey Parrish a79cde2fca Add MediaSourceEngine
This wraps all MediaSource and SourceBuffer operations in Promises
and synchronizes them.

b/25306817

Change-Id: I73483ba73427d309c4e09cb82ab6404a59e7a726
2015-11-25 12:14:05 -08:00
Joey Parrish 2a34eff924 Add TextSourceBuffer
This is a SourceBuffer-work-alike for text, based on registered
parsers.  Actual parsers are needed now.

b/25323462

Change-Id: If2a3ce3d8a769e53d783304fe24519b8d98e093c
2015-11-25 12:14:05 -08:00
Joey Parrish 63a6a0920b Add IDestroyable
The new destroyable interface is asynchronous.

b/25308062

Change-Id: I275f368c7b18b434d2e263d67baade529149a616
2015-11-25 12:14:05 -08:00
Joey Parrish 03df140fb8 https://goo.gl/RvMyq4 2015-11-25 12:14:04 -08:00
Joey Parrish a24b8e849a Fix annotation mistakes
These mistakes were all uncovered by a forthcoming release of the
Closure compiler.

Change-Id: I84a742cd8fae36cc013f86ff7ae06e7f76501b56
2015-11-18 14:08:47 -08:00
Joey Parrish 5fe357f30b Fix corner case - all streams removed
Our handling of the case in which all streams are removed was
incorrect.  We attempted to add a StreamInfo to an array of
StreamSetInfos.  The mistake was uncovered by a forthcoming release
of the Closure compiler.

Instead of trying to restore the current stream, simply dispatch an
error event.

Change-Id: Ib19144b4894c87481aa9cb2e77c7bea837871cff
2015-11-18 10:49:47 -08:00
Joey Parrish 05e593d5e8 Update changelog and bump versions for 1.6.0
Change-Id: I8fdb562b35bdb2ae77a8250990bfeb0058c8faa7
2015-11-16 14:48:27 -08:00
Joey Parrish 365cb82bbf Merge pull request #231 from baconz/set-start-on-live
enable setPlaybackStartTime on live streams
2015-11-16 12:46:05 -08:00
Joey Parrish 52d218aff9 Jump to live instead of fudging the window
Rather than compute an offset in the live window to account for
startup latency, simply jump to live as soon as the streams have
started.

Fixes #185

Change-Id: Ic88e7554c95daf8afea8e29c688e5895e07336c7
2015-11-13 12:47:13 -08:00
Seth Madison c4ca579088 enable setPlaybackStartTime on live streams
It is nice to be able to set the playhead position on in-progress
recordings, which use "live" manifests.
2015-11-12 20:07:26 -08:00
Joey Parrish 7fabab9c14 Always inherit ContentProtection from AdaptationSet
Fixes #230

Change-Id: Ie1dc63de83a40c270c586f8aee98fa98c214ecb8
2015-11-11 04:05:55 -08:00
Joey Parrish a304a041b2 Combine init datas across Representations
When computing common DRM schemes among representations, we were not
previously combining the init datas.  Because of this, if different
Representations with different PSSHs had their PSSHs in the manifest,
we would only request a license for one of them.

b/25596430

Closes #229

Change-Id: I150f67174df9dc0dbe1c7b32ab7b1a6dea633328
2015-11-10 17:28:47 -08:00
Rohit Makasana 0010a741a3 Add a restriction for video minimum height
Change-Id: I18eec0d6c048a45fde0489656fd35a871f0931e5
2015-11-10 14:43:22 -08:00
Jacob Trimble 7c79ec5a70 Promise polyfill callback can now throw.
The callback given to the Promise constructor can throw.  If it
does, it should reject the promise.

Change-Id: I5e21e408830271e3648bf401fdac73c44ef3cc38
2015-11-10 13:06:15 -08:00
Jacob Trimble 71695ac09f Removes expired sessions.
Closes #210

Change-Id: Id18bbafc936e54b4bba85febf42ab6f332c1fd0a
2015-11-09 23:34:20 +00:00
Timothy Drews 29f8022806 Make @startNumber implementation consistent.
* For SegmentTemplate with @duration, treat @startNumber as the number
  of segments absent from the start of the Period.
* For SegmentList, fix off-by-one error when computing segment start times.
* Add more @startNumber documentation and unit tests.

Issue #192

Change-Id: I0b7950cc6cda0a2cbd345e13bd769a50f83d4982
2015-11-05 19:41:36 +00:00
Joey Parrish 6263e1f668 Add support for YT PlayReady test content
Closes #223

Change-Id: I337fe651f50cae86b34be5829948bc1fb25ddf05
2015-11-05 18:24:27 +00:00
Jacob Trimble fc0f19c469 Support WebM with unknown Segment size.
The init segment for WebM can specify a Segment element of an unknown
size.  This means that the segment should take up the remainder of
the data.

Change-Id: I77b503f1f034396f7ce1bb81d4b7c426a31f8b3f
2015-11-04 19:19:42 +00:00
Joey Parrish 1ebf669350 Require live support for SegmentList and SegmentTemplate
Change-Id: I48b034c7499fe9c648d8c0730481a5f77ae08875
2015-11-03 10:05:16 -08:00
Joey Parrish f3ad0dd431 Re-evaluate track mode
Track mode can be updated by the video element using the browser's
built-in controls.  Therefore we can't treat the enabled_ flag as
canonical if we want to reflect the current status.

Closes #214

Change-Id: I34f2d5b6723efa8b37b58d336d835c0f20edf422
2015-11-02 22:33:32 +00:00
Jono Ward 6db78bad60 Implement suggested changes from PR review; improving clean-up of event handlers, removing some redundant code and some code-style tweaks 2015-11-02 12:26:21 +00:00
Jono Ward c9892f9180 Implementing review comments; code cleanup, mainly code style tweaks and annotation improvements 2015-11-02 12:26:21 +00:00
Jono Ward de36492f5d Add support for IE/Edge/PlayReady 2015-11-02 12:26:20 +00:00
Joey Parrish f248647685 Permit disabling webm and containers in general
Change-Id: I985e460b7be3dd57ee7cc80c80e3ea2d3c85e7d8
2015-10-30 11:53:27 -07:00
Joey Parrish 6fe239150a Exclude offline deps in SourceBufferManager
This makes sure ContentDatabase is excluded if --disable-offline is
given in the build.

Change-Id: Ia35d2e2b5e53b5af54c36b0c96e80f8d3f3e769e
2015-10-30 10:02:11 -07:00
Joey Parrish 89d8b7e94a Add support for raw values in Promise.all and Promise.race
Change-Id: Ifce7a22bc8f17f026c85bd90de2feced7f549b83
2015-10-26 11:39:05 -07:00
Joey Parrish c55978cc79 Add a Promise polyfill
This will help with porting to IE11.  Chrome, Firefox, Safari, and
Edge all have native Promises.

This polyfill does not support thenables because Shaka does not use
them.  Other than tests related to thenables, this polyfill passes
the A+ test suite.

It is also worth noting that this polyfill is incompatible with
native Promises, so it should not be used to replace a native
implementation or mixed with browser APIs that may use a native
implementation internally.

To safely test in Chrome, force prefixed EME (to avoid native
Promises), set window.Promise to null, then load some content in
the test app.  If using a verison of Chrome after prefixed EME
was dropped, use unencrypted content.

To run the A+ test suite, compile the library, install nodejs and the
module 'promises-aplus-tests', then run ./test_promise_polyfill.js.

Inspired by pull #176

Change-Id: I0d25049f162ff7f3b57bbc795403fcdedf927262
2015-10-21 11:12:18 -07:00
Joey Parrish 7b78b9747d Drop unused member in ContainerSegmentIndexSource
Change-Id: I7d95493e56f5efe881c801fff3493269ce766e80
2015-10-20 20:02:12 +00:00
Joey Parrish ff1dcc2820 Refine MediaKeys polyfill error type
Inspired by code in pull #176

Change-Id: I2e29310c8a3583ed208d7bd1ae2e747a92ddf480
2015-10-20 12:42:58 -07:00
Jacob Trimble 5637962073 Offline now doesn't use data URI for init data.
Also now uses the same ContentDatabaseReader for offline segment
requests.

Change-Id: I9cebc90b46ca9067467a8a343d48b264abc7cf26
2015-10-19 23:10:22 +00:00
Jacob Trimble d84428b42f Removed 1.6.0 deprecated functionality.
Closes #203

Change-Id: I52f72030078c2bf69f1da33fae035664ca50daca
2015-10-15 17:14:11 +00:00
Joey Parrish 3a552b808f Remove Uint8ArrayUtils.key
These keys cannot always be used as keys, for example on IE11 where
very large init datas are found in PlayReady content.  Since there
should not be a large number of unique init datas, a linear
suppression pass and a quadratic removeDuplicates should not be a
problem in practice.

Related to pull #176

Change-Id: I9dd9b5e45422544c86dd95686766625a0b336963
2015-10-14 18:09:07 +00:00
Jacob Trimble 1e16366eb3 Update configuration documentation.
Change-Id: I65df78f278e5a02c81aabb03fe3c0b81ff3ed605
2015-10-13 14:49:14 -07:00
Jacob Trimble ed33ef958f Uses correct buffering goal when re-buffering.
Closes #190

Change-Id: Iee663056ce221e8388b9e6bd7b78f587c8ed0191
2015-10-13 11:32:05 -07:00
Jacob Trimble 62adcd40c1 Always apply timestamp correction to OPT.
Closes #200

Change-Id: I821d7a8336cc66593665dbc2ad794adc3fb55918
2015-10-13 18:23:34 +00:00
Jacob Trimble f346ece22c Improve live end-of-stream behavior.
* Supports live streams of a fixed length.
* Live streams that stop now correctly end the video.
* Only uses local MPD when @availabilityStartTime is in the future.
* Added configuration option liveStreamEndTimeout.

A live stream is considered "ended" when the play-head moves past
the last segment for liveStreamEndTimeout amount of time.  This allows
the MPD to be updated with new segments.

Closes #139
Closes #140
Closes #145
Issue #172

Change-Id: I0675203931f35ca3e0dee60a87c54ba74cbdbaea
2015-10-13 18:00:01 +00:00