Commit Graph

28 Commits

Author SHA1 Message Date
Jacob Trimble ee872017ed Added 'app' error type.
Change-Id: I1c56d875ec92291af408a10e01e7d2c8fae24749
2015-10-07 22:28:24 +00:00
Jacob Trimble 9b50f2ad94 Deleting offline content now deletes persistent session.
Closes #171

Change-Id: Ia0ff2c9892f53c2ceeddb2b589e2e2c886aea54a
2015-09-24 22:05:01 +00:00
Joey Parrish 4cc4e96dbd Overhaul license comments and file annotations
* 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
2015-09-08 12:02:34 -07:00
Joey Parrish 4d9177240a Revert "Adding license annotation to js files."
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
2015-09-04 18:36:39 -07:00
Yohann Connell 8cb24652cb Adding license annotation to js files.
Change-Id: Id10592ccaf35608ac4f01844cae2fec4a2030d65
2015-09-04 00:05:17 +00:00
Jacob Trimble 899c322995 Added support for multiple BaseURL elements.
Added a new class called FailoverUri which handles multiple URLs and
switches to others when one fails.  This is also handles the request
itself.  This replaces SegmentMetadata as well as a number of manual
requests.

The MPD parser now produces arrays of URIs rather than just one.  The
MPD Processor then converts it to a FailoverUri inside the manifest.

Added unit tests to test the new functionality and updated the old ones
to the new changes.

This does not support failover on subtitles since subtitles are handled
by the browser.

Closes #68

Change-Id: I5410104827b9e4102b243444b1b5a3f01dcaf10d
2015-08-10 16:01:06 -07:00
Timothy Drews 7623b58fea Fix ContentDatabase/AjaxRequest circular dep.
The circular dependency,
ContentDatabase -> RangeRequest -> AjaxRequest -> ContentDatabase,
causes issues for the upstream Closure compiler. This patch breaks that
cycle by factoring out reading and writing operations from ContentDatabase
into ContentDatabaseReader and ContentDatabaseWriter respectively.

The following minor changes have been made to code that has moved:
* Removed retrieveInitSegment() since it's not used.
* Changed .stream_ids to ['stream_ids'] in retriveGroup().
* Reworked deleteGroup() so that it doesn't depend on retrieveGroup().
* Made deleteStream() private.
* Made minor formatting changes to meet the 80 character limit.

Change-Id: Idfc5d04ad32225a915b1531e0f4205137de5cc73
2015-08-10 14:23:32 -07:00
Natalie Harris 3936bfafb6 Player configuration should not use static variables.
Closes #126.

Change-Id: Ib8ef19e46918276f28d6539a158517f8558867d1
2015-08-04 08:51:22 -07:00
Joey Parrish 6669cfbc12 Remove Promise workarounds
Now that google/closure-compiler#715 is fixed and we have upgraded to
a newer compiler, we can remove these casts.

b/21559591

Change-Id: I7769d95d7b440c648eb78e026d94544c640c41b4
2015-07-14 03:31:11 +00:00
Joey Parrish 328aa27c59 Fix type-inference issues with newer compilers
Newer versions of the Closure Compiler issue warnings for several
anonymous functions due to what appears to be a failure to infer
certain types.  This patch uses TypedBind to mollify the compiler.

This patch also fixes another issue raised by the newer compiler,
which is that index does not have duration and key_system properties.

b/21559591

Change-Id: Icff84ad084bfcd049f962bd4a0698b3fc78fc279
2015-07-13 13:56:16 -07:00
Timothy Drews fbea2279b3 Re-work stream switching.
* Allow segments from different streams (Representations) to coexist
  in buffer.
* Only fetch a single segment at a time.
* Remove id field from SegmentReference and remove SegmentRange.
* Only start the Streams once the buffer is "full".
* Stop DashVideoSource from triggering an extra resync during startup.
* Make Task.abort call order deterministic.

A follow-up patch is required to handle certain seek patterns in
live streams.

Issue #51

Change-Id: Ib7c9021471f1ed89323f19764463202b119cb491
2015-06-18 12:54:25 -07:00
Joey Parrish 8efe577459 Fix offline percentage
This was broken by a bad reduce, in which the initial value of "sum"
was an object.

Change-Id: I3ce2d723e9274dd7c3c86340d321ef8e3d030792
2015-06-12 22:12:55 +00:00
Timothy Drews 22c57e99e4 Rework SegmentIndex functionality.
This patch reworks SegmentIndexes so that any SegmentReference they
contain is guaranteed to be available. This makes SegmentIndexes work
consistently between static content and live content (specifically
content specified using SegmentTemplate with @duration).

* Rework StreamInfo to use a ISegmentIndexSource and a ISegmentInitSource,
  which construct a SegmentIndex and an intiailization segment
  respectively.
* Make ManifestInfo destructible and various async operations in
  StreamVideoSource safer.
* Introduce LiveSegmentIndex, which manages SegmentReference eviction.
* Introduce DynamicLiveSegmentIndex, which manages SegmentReference
  eviction and generation.
* Implement improved segment availability logic for segment eviction.
* Move SegmentIndex construction from MpdProcessor to several
  ISegmentIndexSource implementations.
* Use a SegmentIndex to represent subtitles to simplify Stream creation
  in StreamVideoSource.
* Move manifest update code from StreamVideoSource to ManifestUpdater.
* Move PeriodInfo.duration determination in MpdProcessor to StreamVideoSource.
* Since "forced" manifest updates are no longer required for content
  specified using SegmentTemplate with @duration, simplify manifest update
  code in DashVideoSource.
* Make Stream continue to update even if it runs out of
  SegmentReferences, this simplifies previous resync logic and makes
  DynamicLiveSegmentIndex work seamlessly.
* Refactor SegmentIndex and initialization fetch code in ContentDatabase.
* Download all SegmentIndexes in the background after the initial streams
  have started.

Follow up work is required to remove seek range logic from
DashVideoSource.

Change-Id: I4a908195aba632a911a6e55213fc41d41428162b
2015-06-09 11:46:40 -07:00
Natalie Harris 23e7a8e11f Progress events for Offline storage. Issue #22
Change-Id: Ic8c24241b8a55a42c4207084491e5a3e2a0d0a86
2015-04-24 16:45:24 +00:00
Timothy Drews d414d4eaa7 Fix load stream in compiled mode.
* Move retrieveGroupIds to OfflineVideoSource.
* Quote properties of stored objects to avoid variable
  renaming issues.

Issue #22

Change-Id: I31ca1261411de5ff5ae4859da571d0029ed77f42
2015-04-09 16:16:40 +00:00
Natalie Harris a0aa5e51c6 Retrieve list of currently stored group ids. Issue #22
Change-Id: Ifeaa4085ec289679ccd9cb1fc22bd400c9cd8198
2015-04-07 15:32:36 +00:00
Timothy Drews b8b3ad862b Cleanup SegmentIndex, make merge() more robust.
* Rename SegmentIndex functions to shorter names.
* Add first() and last() functions for convenience.
* Throw exceptions for out of range errors.
* Handle more corner-cases in merge().
* Add more unit tests.

Change-Id: If875cd766e7091504c028413694326fcdf2aae5b
2015-04-06 22:07:17 +00:00
Joey Parrish 5d40798f59 Check for IndexedDB support.
Issue #22.

Change-Id: I334eb6f91894fb13a56911d50827514b504f3c25
2015-04-02 17:47:12 +00:00
Natalie Harris 6e6e8b4aad Fixing issue with ContentDatabase. Issue #22
If a stream insertion didn't complete successfully, it was possible an error
would occur during the next stream insertion due to a key (streamId) conflict.
Updated to always take the max next stream id from the indexStore/contentStore
and to try to delete partially inserted streams.

Change-Id: I85c379a6ef17853da28ae873c448873006b1dce4
2015-03-27 13:18:37 -07:00
Natalie Harris 6f573def03 OfflineVideoSource load and addition of offline to test app. Issue #22
Change-Id: Iad9737829c7404443849c48420d2d81d32857bf8
2015-03-27 19:57:49 +00:00
Natalie Harris c97ebf3485 Support for EME offline. Issue #23
Change-Id: I27632f196b6ec65ace67d3ee9794683fd9f639ab
2015-03-25 22:22:42 +00:00
Natalie Harris 18a843eef7 OfflineVideoSource store functionality. Issue #22
Change-Id: Ib55ce40619929f7139a0651f0e0874a0bd4fc054
2015-03-16 17:22:50 +00:00
Joey Parrish ae35ac25bb Fix ContentDatabase test crashes on Chrome 42+.
Chrome 42+ is crashing when we insert roughly 64MB of data into the
database at a time.  The database now tries to batch up 1MB of
segments, which means only single segments will be inserted for high
bitrate content, but we will still get a performance boost from
batching up segments for low bitrate content.

Change-Id: I3205b108dc089ea2901ea6b9eae5125901535f0c
2015-03-05 11:41:50 -08:00
Joey Parrish d2d6f67a52 Fix ContentDatabase test failures.
Tests were failing if an existing database had a greater version
number.  This was an artifact of an older version of ContentDatabase
which used a different version number.

Tests would also fail if one of the 'stores a stream' tests was run
several times in a row, such that the stream ID had more than one
digit.  The reference matcher now accepts multi-digit IDs.

Change-Id: I8d8949e46bd0720abd761248790b2ee5965ff4a1
2015-03-05 19:34:49 +00:00
Joey Parrish f43cfff622 Fix ContentDatabase error reporting.
Rejected promises now pass an Error object instead of a simple event.
This causes test failures to display useful error messages now.

Change-Id: I9d9a756e84d204185ca9a2e36ca92ef814d05e4d
2015-03-04 13:56:25 -08:00
Natalie Harris 4a8d26af9b Support of idb URI's.
Change-Id: Ie964da2d435349be6c2ee9a88202f1c058b8ed05
2015-02-27 23:16:15 +00:00
Natalie Harris c6a74f3171 Additional functionality added to ContentDatabase. Issue #22
Change-Id: Ic00a42b7bfcd0619adf358f4907675e7c7767bb7
2015-02-25 15:52:53 -08:00
Natalie Harris 302f6faf64 Offline storage module.
Change-Id: I6d67faf99d535c0c77764b3c3b6311736ce8f9e1
2015-02-04 01:24:09 +00:00