Commit Graph

20 Commits

Author SHA1 Message Date
Joey Parrish 93bcf28e41 Fix mixed content URLs in integration tests
Change-Id: I9b50b581b341302fbeaf127c411e16d9927facf2
2015-10-20 16:41:24 -07:00
Jacob Trimble 1f88c9dae1 Reorganize integration tests.
* Split player_integration into several files.
* Moved some helper methods from player_integration to
  integration_util.

Closes #188

Change-Id: I14cb2eda8375fc24ef0419e7993027b90e881d5b
2015-09-28 23:09:51 +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
Timothy Drews f5c4eb1667 Improve end-of-stream behavior.
For static content, if the playhead moves to the end of the video then
either the video should pause or loop. Before this patch media timeline
misalignment and buffering detection would sometimes prohibit this from
happening.

* Ensure the MediaSource's duration is >= the end of each
  stream's last segment (both before and after timestamp correction).
* Use an append window to keep the MediaSource's duration constant.
* Rework Stream startup so that the MediaSource can be modified
  safely during timestamp correction.
* Remove timestamp correction member variables from StreamVideoSource.
* Fix buffering detection when there are no buffered ranges.
* Add sanity checks and improve logging for debugging MSE issues.
* Improve Stream startup documentation.

Closes #155

Change-Id: I6f7a1d15240af62a2282f3f62b29cd3acd5b1873
2015-08-19 09:30:00 -07: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
Joey Parrish 39c4b42176 Add waitUntilBuffered in integration tests
This eliminates an arbitrary delay to make 'seek does not hang when
seeking to evicted data' more robust.

This also increases overall timeouts for the integration tests and
for Karma.

Change-Id: Ic119b219cb0a596d9e949ef25acf4d771e69298e
2015-07-14 18:13:05 +00:00
Timothy Drews 59723f10c3 Add configure/getConfiguration API to Player.
Also deprecates some existing getters and setters.

Closes #93

Change-Id: I167e6764bb26c1d37c88b7fbee4a4880181f9812
2015-07-13 20:07:13 +00:00
Joey Parrish 8ed79d610b Fix linter error in live integration tests
This is exactly why we need to enforce automated testing on all
changes.  :-)

Change-Id: Ibb2a11afed8a0be902ba241af76907c5d770e7a4
2015-07-08 18:08:18 +00:00
Joey Parrish a8a81a9d41 Suppress test failure in Chrome Linux
There's an intermittent test failure showing up in Chrome on Linux,
and we've traced it to a bug in Chrome.  Until the bug is fixed,
detect the ffmpeg decode failure and restart the test.  This seems
to be a reasonable workaround for now, and will be removed when the
bug in Chrome has been fixed in the channels we're using for
automated testing.

Change-Id: I1fa3fed2e83ce12f308714b44809efde5fd1e626
2015-07-08 17:58:05 +00:00
Timothy Drews 34915527f0 Complete stream rework: refactor seek ranges.
* Move seek range updates into SegmentIndex implementations
  and StreamVideoSource.
* Remove unnecessary sub-class hooks from StreamVideoSource.
* Remove internal LiveSegmentIndex timer: do SegmentReference eviction
  and generation on demand.
* Rework Stream startup again: consider Streams as started when they
  have buffered some minimum amount of content. As part of this, only
  apply a timestamp correction to the SBM when the streams have started.
* Defer stream switches until all SegmentIndexes have been corrected.
* Partially revert optimistic "bufferedAhead" calculations in Stream:
  check if we've buffered enough content at least every second.
* Make LiveSegmentIndex more robust against a "wrong"
  @availabilityStartTime.
* Fix a bug where a positive timestamp correction would trigger an extra
  Stream resync.
* Fix a bug in evict_() where the first segment would never get evicted.
* Check stream started conditions in onUpdate_ instead of after a segment
  has been inserted.
* Tidy-up immediate/clearBuffer naming and other comments.

Closes #51
Closes #109

Change-Id: Ic6f0b96065d3c5dfb5c03ca1c52363bd77b22875
2015-07-06 14:20:01 -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
Natalie Harris e2b355fe1f Timestamp correction test for segment duration template.
Change-Id: I676e0c8bad4af85c9e78491fc9acf28c4c89e4b2
2015-06-16 13:06:02 -07:00
Timothy Drews 96b369e3fa Use a fake error to avoid exceptions in tests.
Promise.reject() was causing error.type to be undefined in
the final catch block of StreamVideoSource.onUpdateManifest_().

Change-Id: Id5ddf8901e38559889e41d389b96c620b3dfaaa7
2015-06-09 12:17:14 -07: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 eb6d5731fe Adding segment time mpd live integration tests.
Change-Id: I328936fdc789f6fe6fcc6e731928bbafdeffbdea
2015-06-08 15:10:12 +00:00
Natalie Harris a38dabfc6e More live integration tests.
Change-Id: I12b6ab973975d939f9024991864574fb06df7bf5
2015-06-02 10:21:19 -07:00
Natalie Harris fcbf4da0c8 Update player destroy to return a promise.
I was seeing errors in the integration tests due to setMediaKeys not
finishing before the next test was started. This ensures that the
mediaKeys will be null before each new test run.

Change-Id: Iaaa9dea67b315b1a91ec83668fb0ed9ffaa3f087
2015-06-02 10:21:19 -07:00
Natalie Harris 01abbf5952 Two live integration tests for Segment Duration MPDs.
Change-Id: I1a3489a72ec79c76d4b8de4e376de2cde98cee68
2015-05-28 08:51:26 -07:00