Commit Graph

359 Commits

Author SHA1 Message Date
Joey Parrish da03f4391a Revert in-progress recording (IPR) support
These patches and IPR support in general will be revisited when we
have a better model for how this should work.

Closes #463

Change-Id: I2c5fe372986a9af232b052c67f8e5c3ba6585cee
2016-07-28 16:49:08 -07:00
Sandra Lokshina fcb4df53ca Refactor Mp4SegmentIndexParser and add unit tests and a test asset for it.
Change-Id: I216d389fa53d8f6aa1ffdd1111bdcd965ce1732f
2016-07-20 22:14:55 +00:00
Joey Parrish fb7cc53a4e Push language into Representations
Duplicate language information from StreamSet to Stream.

This will simplify the task of determining when a configuration
change triggers a language change.

Working toward a solution for #435

Change-Id: I461f7e8974f1e09b0b6f38edfab901b3f89eb3bc
2016-07-20 13:37:59 -07:00
Joey Parrish 24f8f189ef Guess contentType by checking TextEngine support
This allows us to support manifests where AdaptationSet does not
specify an explicit contentType of 'text' for Representations
containing 'application/mp4; codecs="..."' text streams.

Also makes the demo app more resilient against unexpected track types.

Change-Id: Iec46f49d1b7726bec1b8d24bd6cc6f3fd2101ab4
2016-07-19 23:03:16 +00:00
Joey Parrish b7af879583 Remove hasOutputRestrictions
If a key status is 'output-restricted', treat the key as unusable.
In many cases it is, and we have no way of differentiating when it is
or is not.  So our treatment of this status should be conservative,
and we should treat the key as unusable.  This will prevent
HDCP-related failures that may be caused by adapting to a stream whose
output restrictions may not be met.  The hasOutputRestrictions flag on
streams and tracks is now gone.

The caveat to this change is that if content is encoded with the same
key for SD and HD, and HD streams have HDCP restrictions that cannot
be met, we will now consider both the SD and HD streams to be
unplayable, even though we could still play the SD streams.  Because
we can't separate the status of the two streams, we don't know for
sure if the SD streams can be played.

We will no longer support such content due to the complexity of doing
so, and due to the risk of playback failures on adaptation to
restricted streams.  Streams with different security requirements
should always be encrypted with different keys.  Content which does
not follow this best practice will no longer be playable in Shaka
without modifying the player.

Change-Id: Ia29db8efa0b6f83c0376199dea5210c9b468bc40
2016-07-13 10:40:24 -07:00
Joey Parrish 316b7febb6 Merge pull request #426 from baconz/fix_live_check_in_fit_references
fitSegmentReferences: Check isLive() using presentationTimeline
2016-07-07 11:57:35 -07:00
Joey Parrish c1c176a529 Restore ClearKey license server support
- Restore ClearKey as a recognized key system in the DASH parser
 - Query key systems with configured license servers first, so that
   we can continue to differentiate between unavailable key systems
   and under-configured key systems.
 - Add a new ClearKey license server test asset.
 - Update tests.

Closes #403

Change-Id: Id5ef46d2d35a0217d313f03d403058c5c279e878
2016-07-06 17:25:37 -07:00
Seth Madison ab86551814 fitSegmentReferences: live check should consider timeShiftBufferDepth
If we rely on duration != null in-progress recordings get their
last segment stretched to the end
2016-07-01 17:06:51 -04:00
Andy Hochhaus 87a62d717e Add missing goog.require() dependencies 2016-06-25 15:45:15 -07:00
Jacob Trimble a3c1ed29d4 Defer filling URI template until request is made.
Instead of filling the URI templates when parsing the manifest,
wait until the request is made to fill it.  This reduces the time
it takes to parse the manifest.

This was tested using a stream with a 24-hour timeShiftBufferDepth.
Using a Chromebook pixel running Chrome 51.  The average manifest
parse time was about 1 second before, now it is about 200ms.

Issue #405

Change-Id: I89f36085441f6c6b7d6281b24b671dc668f23fe5
2016-06-23 21:15:19 +00:00
Jacob Trimble 7aab332e9b Correctly use suggestedPresentationDelay in seek range.
Before, we did not use suggestedPresentationDelay in the seek range.
This meant that seeking to the live edge would usually lead to a
buffering state because the seek range is the same as the availability
window.  Now the seek range is handled differently from the
availability window.

b/28938315

Change-Id: Iacfffe30778f7c63734fe24eeb95634611da86be
2016-06-22 22:06:51 +00:00
Joey Parrish 792c44a792 Do not reject "application/*" streams
Otherwise, we fail to play manifests containing TTML.  Without a TTML
parser, TTML streams should be ignored and not cause failures.

Issue #111

Change-Id: I982ad04083e40a3f5c5023f0059fa4ae1604ab07
2016-06-22 20:32:40 +00:00
Jacob Trimble 6cc9613803 Add support for storing protected content offline.
Now the Storage class can store protected content and play it back.
When deleting it, the offline EME sessions will be removed.  Also
now offline support appears in Player.support().

Closes #343

Change-Id: Ic5b5a0e0854d80f7821e04e751275abf40ee6eb6
2016-06-16 18:30:25 +00:00
Jacob Trimble 0530362b97 Add separate error for missing key system URI.
Before, the same error was used for no available configurations or
key systems and for missing key system URI.  Now there are two
different errors.  Also elaborated on the error in the documentation.

Closes #371

Change-Id: I9b72daa0a99b4761714a74c3ceba60c873c89a77
2016-06-03 00:11:41 +00:00
Timothy Drews fe9189e413 Allow Representations without Segment* elements.
Representations without Segment* elements or which do not
specify "text" as their type are now ignored instead of causing
failure.

Issue #368

Change-Id: Ica6490442dc38c7fdbc778eb0650dd7909d764c5
2016-05-25 00:18:01 +00:00
Joey Parrish b73eeb89d2 Fix support for relative paths in UTCTiming
UTCTiming and configured clock sync URIs can now be relative.

Closes #376

Change-Id: I45f2a22ec6ddea7e345f6df71ebd4195aa3981a7
2016-05-24 18:49:11 +00:00
Timothy Drews b83a9c0a27 Handle output-restricted key status.
If a key is output-restricted it may still be usable.
So, instead of disabling these tracks, indicate that they
may be playable.

Issue #199

Change-Id: Ic13a02d97ccc21533118f17aa907c16d1cda05ce
2016-05-09 15:10:31 -07:00
Joey Parrish 0a3d6bd5b8 Add an option for default clock sync URI
Applications which cannot control their manifests may need to specify
a default clock sync URI for use when UTCTiming elements are missing.

Closes #290

Change-Id: I5704b25d2d3199ceb932f8102490a9b3e8a27dac
2016-05-04 07:44:15 +00:00
Joey Parrish 2e19ebe14a Revert "Update clock sync on manifest update"
Hitting UTCTiming sources over and over could be considered abusive
behavior at scale, so we will only sync the clock once on startup.

The change to update clock sync on manifest update was added for #345,
but it seems that this was not part of the fix, since the content in
that issue had no UTCTiming element at all.

Change-Id: I32f4fc0a40fc92feeb54191e5fe869e0aaa9b54c
2016-05-04 07:44:15 +00:00
Joey Parrish 1fb78929c1 Warn when UTCTiming is missing for live
Without a UTCTiming element in the manifest, a client cannot
synchronize its clock.  This can easily lead to playback failures,
so we warn application developers when we detect this.

Issue #290

Change-Id: Idcb395f5ece67bf2c7d0d984ad277f552d030eb8
2016-05-03 18:47:55 +00:00
Joey Parrish 8ad7762a7c Fix typo that broke docs build
Change-Id: I7f12215097beb99792eaea6b9e4c2fc4de87524d
2016-05-03 18:45:26 +00:00
Timothy Drews 294bcca4e9 Treat absent timeShiftBufferDepth as infinity.
This patch also enables presentations to start in live mode
and end in VOD mode.

Issue #351

Change-Id: Idc0ad0c69887d61d080f844ef388222d1228a535
2016-05-02 14:22:38 -07:00
Joey Parrish bc17162407 Fix key system content type checks
Some browsers, such as Edge 13, do not report capabilities at all.

Not all encrypted streams have known key IDs, so we should not
use that as a predicate for the encrypted content type filter.

Since not all content has both audio and video, the requested and
reported capabilities may not have both either.  So we should
default capabilities to empty lists if missing.

This also adds an encrypted audio-only asset so that audio-only is
covered by our integration tests.

Closes #342
Closes #360

Change-Id: If5973c4ddea358d96ab305700e027021b1a7b65a
2016-05-02 18:22:52 +00:00
Timothy Drews 1108700f10 Use segment info to adjust the pres. timeline.
* Permit non-zero presentation start times for VOD: some
  presentations have segments which start too far from 0 to
  allow the video element to begin playback; now the player will
  start VOD presentations from the start of the first segment.
  However, segments of the 2nd, 3rd, 4th, etc., Period of a
  multi-Period presentation must still start close to 0 (the
  player will not jump any gaps in the presentation).
* Prohibit seeking to regions at the beginning of the segment
  availability window if segment information is missing from
  that region: sometimes live manifests do not contain all the
  segments in the segment availability window; now the player
  will prohibit seeking to these regions.
* Update definition of live in DashParser to match Player and
  Playhead.
* Simplify PresentationTimeline's constructor by just using setter
  functions.

Issue #341
Closes #348
Issue #357

Change-Id: I96c22774448476bea89ff4014f03b87bdb51ba07
2016-04-26 21:09:57 +00:00
Jacob Trimble f9552a5359 Update clock sync on manifest update.
Issue #345

Change-Id: I9faef800444e3b818c8da64cf71848a99713c3ff
2016-04-22 09:52:45 -07:00
Jacob Trimble cc243faac9 Improve live stream support
* Support minimumUpdatePeriod="PT0S".
* Fix comparisons with very large timestamps.
* Assign default Period ID if not given.
* Increase suggestedPresentationDelay.

Closes #331
Closes #339

Change-Id: I091cb7ab3e2a1cdb38e4161fe139a96a10de3807
2016-04-21 23:38:04 +00:00
Timothy Drews d36bb6bcf0 Set maxSegmentDuration for ST w/ duration.
Also add more unit tests for maxSegmentDuration.

Change-Id: I7648f64ab9f90c70d1daf53f30a3d558b7a899f3
2016-04-21 23:04:27 +00:00
Jacob Trimble e1d834f3c2 Add track restrictions to Player.
Now the application can restrict the kinds of tracks that the Player
will play.  This is done through player.configure().  This also
allows restricting the playable tracks based on the EME key status.

Closes #326
Closes #327

Change-Id: I88210ece6fd1db886c49d4599fbe5814d394132d
2016-04-15 12:21:24 -07:00
Joey Parrish 9e7c000735 Fix typo in method name
Change-Id: Ie39a118190b8a81295f9181b2765eb047f8f54b7
2016-04-11 16:32:20 +00:00
Joey Parrish 8df544637a Default track language to "und" - undetermined
The default language code should be "und", since a blank string is not
a valid language code.

Change-Id: I5c201d98492881658820c512332f23444c415504
2016-04-04 17:12:44 +00:00
Joey Parrish 32e351d060 Add @namespace annotations to static classes
Without @namespace annotations, static classes do not show up in the
generated API docs.  Although I stumbled over one instance while
writing tutorials, the rest were discovered programmatically by:

for x in $(find lib/ -name '*.js'); do
  grep -Eq '@(constructor|interface|namespace)' $x || echo $x
done

Change-Id: I97dd2bb4bf3faad5ac8d952a28837fa1f594deb9
2016-04-01 11:37:41 -07:00
Timothy Drews 0b4398fc7c Don't replace PresentationTimeline on MPD update
Only update segment availability duration.

Issue #295

Change-Id: Ia73338be4c308169f28f5394c9d4ef5dbc8af304
2016-03-31 19:12:27 +00:00
Joey Parrish a9b4cd89d0 Merge pull request #315 from cmgrecu/master
Update end time of last segment in a period when new periods are added

Fixes #310
2016-03-29 13:28:37 -07:00
Jacob Trimble 8b85e58f73 Add several utility functions.
Change-Id: Ifbd2582747d2cb54d4abda789b0989b7a6b77aa6
2016-03-29 20:17:44 +00:00
Costel Madalin Grecu 013f1e6478 Remove outdated todo item 2016-03-29 11:24:15 +03:00
Joey Parrish 9263bddbb4 Default text tracks to subtitle
Change-Id: I56e1f79eaf55dc01a2a6e8e28a3121de81a9864b
2016-03-28 16:47:34 +00:00
Timothy Drews 3e300d25ae Fix live-edge calculation.
The live-edge calculation in PresentationTimeline needs to take into
account the duration of the current segment since the current segment
is not available until it has ended.

To do this we use MPD@maxSegmentDuration when available, and compute our
own maxSegmentDuration when it's not (as specified by the DASH spec).

Change-Id: Ic5b8478dbbff8eac93cf123a00a8b02db140cf15
2016-03-22 20:50:51 +00:00
Joey Parrish bc1958fd3e Fix timeline duration for multi-period live streams
Multi-period live streams have no presentation duration and have no duration
on the final period.

In this case, we were setting the timeline duration to the start time of the
final period, based on end = start + duration with duration == null.

This fixes the situation so that timeline duration is infinite.

Relates to #310

Change-Id: I8592318e3d4c5643fa1fcc03b34624957a2e974c
2016-03-22 01:23:06 +00:00
Joey Parrish e50832f372 Do not require AdaptationSet ids for update
When updating a DASH manifest, we can key off of Period and
Representation only.  The spec says that Representation IDs are unique
within the Period, and that Period IDs are unique within the
presentation.  Therefore we do not need an AdaptationSet ID to merge
on update.

Relates to #310

Change-Id: I12b9f83c2bfda958a14e9ee31d459c04da8722e6
2016-03-21 16:38:31 -07:00
Joey Parrish fe66d55267 Merge pull request #307 from cmgrecu/master
Fix presentationTimeOffset handling in v2 #297
2016-03-20 21:23:02 -07:00
Costel G d56cbb1385 Add PTO support for SegmentBase 2016-03-20 15:36:28 +02:00
Costel G 543481df14 Correctly apply PTO in SegmentList 2016-03-20 00:26:56 +02:00
Costel G 2f5d8e8376 Implemented presentationTimeOffset in SegmentList 2016-03-19 10:30:42 +02:00
Jacob Trimble e74f43bb94 Add clear key to ContentProtection key system list.
This also changes DrmEngine to reject key systems that do not have
any license servers, this causes init() to fail.

Change-Id: I10148c2caa2ffc57bf6c5f16421ed0600d98be95
2016-03-17 23:09:50 +00:00
Costel Madalin Grecu c0e0aef46d Fix presentationTimeOffset handling in v2 #297 2016-03-16 12:08:06 +02:00
Jacob Trimble 19973d63f4 Changed copyright headers from 2015 to 2016.
Change-Id: I429ff27e4794c03b7ea392e38415075077f9bfb1
2016-03-15 16:32:13 -07:00
Joey Parrish 4e7a0c2258 Correct segment fit check
The sense of the condition was inverted, causing final references not
to be fit to the period

Change-Id: I4b83643ae029e0bf285be37238418c827fd3093b
2016-03-15 14:35:48 -07:00
Joey Parrish 03be508b62 Fix jsdoc error
Trailing comma in this typedef caused jsdoc to have a fit.

Change-Id: If0734940ec989ac23480309112a676c67adebfd3
2016-03-15 21:10:12 +00:00
Timothy Drews 1007ffbc5e Fit SegmentReferences into their Period.
This ensures that small gaps from the start of the Period or from the
end of the Period are not interpreted as missing SegmentReferences.

Change-Id: I7492faef8e44067494e3daf3ff73742fa914d1e3
2016-03-15 13:50:19 -07:00
Jacob Trimble 8b99513242 Removed live check from Dash parser.
Our new interpretation of whether a stream is live is if there is
no duration.  This removes the old check for type='dynamic' from
the Dash parser.

Change-Id: I58aa1a785c7e949be7b48ab5b3b409cbf8e828a6
2016-03-14 21:19:32 +00:00