We do a lot of tear down in DrmEngine at the same time. While this often
works well for common tasks, when tasks focus on different parts, it can
introduce some race conditions.
This change looks at being a little more strict about the order we do things
in DrmEngine destroy.
While this does not fix#1728, the hope is that this will correct the
"read property 'catch' of undefined".
Issue #1728
Change-Id: Id3cd25b416969ecd75a8cdd6d36959e34673fa1b
When we create a media source engine instance, we pass in
a closed captions parser. However a key subtlety was missing
from the parameter description; media source engine is taking
ownership over the parser.
Change-Id: Id49483ccac4cc1812c31ead9e82c09390ce2ed37
It appears that Chromecasts stop a fraction of a second before a gap.
This would sometimes cause them to stall on gaps in a way that the
stall prevention would not fix.
This changes Chromecasts to use the large gap threshold, to fix those
cases.
Issue #1720
Change-Id: Ifc6720e55ab35b81b8592dad2ba7e7293983a755
To make it clearer that the CloseCaptionParser uses MuxJS (and therefore
it requires MuxJS) it has been renamed to be MuxJSClosedCaptionParser. To
further isolate the dependency on MuxJS, the support check that we must do
before using the Caption Parser has been moved to a static function on the
parser.
Change-Id: If3385f192434d8f8ce0c1cadbc6365a7c5df9d5d
We have a utility to test what platform we are running on. It looks
like the chromecast tests were not making use of it.
Change-Id: I0eddbf1fe1aa2c1707947a3c268672a3808ec4dc
Updated the shaka.util.Timer class to ES6. In this upgrade, the implementation
was slightly changed to make better use of arrow-functions.
Documentation for the class was expanded on to better document how multiple
calls to start would work. To ensure consistency, both "schedule*" methods were
merged into a single "start" method.
Issue #1157
Change-Id: Iae86cae4d9cb751f0985ef20c371c0023c40bd53
Before, we would schedule (and reschedule) the poll function in the
playhead observer. We do this a lot in other classes and even have a
timer class to do that.
This change updates Playhead Observer to use the Timer class to handle
the polling events.
Change-Id: I5982ab08de47d4f8a71ab467989f63c06d0853d2
(cherry picked from commit b8a807b2ef0b2906ee3856a9b2a5dc4922973679)
It looks like the assertion for deprecation was inverted, it
would expect that the enforcer was created even before the
first call.
Close#1744
Change-Id: I74b0321d8db497612b29aaac59678373587b2a8a
Rather than using tracks (that merge the roles) use the streams when
creating the audio-language-role pairs.
The reason we tried using tracks was to remove the need to handle
audio muxed into video streams. With this change, that problem is back
but we fixed the broken behaviour.
Issue #1731
Change-Id: I837406469195956089f33f93f4a9e3c64ffbeab2
|applyPlayRange_| in |Player| was previously passed |isLive| but that
value would come from the timeline that it was already passed. Instead
of passing in |isLive| this updates |applyPlayRange_| to check the
the timeline for the "is live" condition.
Change-Id: I13efccd14b9177d2fd652347dce55338d74b7ec8
(cherry picked from commit d02959f3288ec140098d555559bcab9c51d02ca7)
This is consistent with our other configuration settings that are
used as overrides and the manifest values are used as the default.
This means for the manifest URL to be used, there needs to be no
license server URL given in the configuration.
Issue #484
Change-Id: Ib332fe66cd0b13613a17b4ca59496c5185ee65c9
It looks like the lack of a constructor is at the root of the compiler
warnings when you try to alias a class.
To stop the error, I have made a small modification to the session
deleter class so that it could have a constructor.
Change-Id: Iad4614d80dc317b20f01930019096fb388b74ed9
Now that we have Safari 12 in the lab, we have found that it requires
the same MediaSource polyfills as Safari 11.
Fixes b/120434307
Change-Id: I45f8be79d0aca7987ffcba1ce13b8589a2287712
This integrates the deprecation tool with our library and updates
all the deprecated warnings to use our new tool.
As some features needed to be removed in 2.5, this change removes them
since their deprecation checks would make us fail.
Change-Id: I28310bbe9df6839719f4763a96026d5968bdcea6
Define a set of tools that we can use to track, test, and communicate
features that are being deprecated.
When you want to communicate that a feature is now deprecated, you just
need to put:
```
shaka.Deprecate.enforce(MAJOR_VERSION_NUMBER,
MINOR_VERSION_NUMBER,
'Your message about what is being deprecated');
```
This will now print warnings when the feature is waiting to be removed and
print errors and fail asserts when the expiration has passed.
Change-Id: Ic66c53ecdfba7922cf961c7f588ab06beceb16ac
Define class that will be used by the deprecation system for handling
library versions. We are only going to support deprecating at a
minor-version number level. We are able to use this to our advantage
when implementing Version as it makes the code MUCH simpler.
Change-Id: I041bc8d7c20a277d84fb621479b3116e3751e319
The original threshold logic in getGapIndex was for IE/Edge
bust was later updated to include Tizen. However the comment
around it was not updated.
This change updates the comment and the code to better
communicate what all is affected.
Change-Id: I05638a5e51e6052946c67c3bc2850d0347c1ce21
To make it easier to know where we are check what platform something is
(normally a sign of a work-around), this change isolates the logic to
make the check into functions.
Now looking for uses of |shaka.util.Platform| should show when we are
using platform-specific logic.
Change-Id: Ief49837c503e951f7138ec08a83355fe1c46db88
To fix the race in #1696, StreamingEngine now checks its state in
loadNewTextStream to ensure that it does not start a race between
the startup phase and the new text content.
Fixes#1696
Change-Id: I0f323a5d56b0585fb6e356308aa9eedeee8156b2
Instead of requiring media source engine to create its own closed
caption parser and then allow tests to override it, have it be
passed into the constructor.
This allows us to easily use the fake one in all our tests and
removes the need for a test only method on media source engine.
Change-Id: Ia1d4f0bb988dca30699b30ccaf4522126f357f90
Similar to Transmuxer, adding a Caption Parser class as a wrapper of
mux.js's Caption Parser, and move all relevant operations from Media
Source Engine to Caption Parser wrapper class.
Issue: #1404
Change-Id: Iaafa22a963b53315e1f7ae52a5fe17a4cd3f2bde
Before we had a method that would return all the supported types. The
only public use of this method was in the tests. Within DrmEngine we
would only use it to see if we could support a content type.
So instead of needing a caller to know about working around edge,
this changes it work around to be limited to one function.
This then allowed a consolidation of the other "support" methods in
DrmEngine.
Change-Id: Ia2a3484b0f8c9be51fe58955ac1ed146d4e7ba0a
In the methods use for testing, when getting the number of
close caption cues, we were only addressing the channel by "id".
This updates the name to be "channelId" so that it is clear
what the id will map to.
Change-Id: I773d5a63c376b832d492b41cf2505d8a27ea0f32
This change refines and emphasizes the message of the test only
methods for closed captions in text engine.
Change-Id: I0f13f0fa48f3b464c8dc4166ddbd12f09f53874c
The close caption map cannot be null in text engine, but we were
still checking if it was falsy. Since it can't be null, we can remove
the falsy check.
With the falsy check removed, the expression was able to be reduce
even further.
Change-Id: I839bc2337cfa1415cc6b00b75602e608f75b0e13
Added an alwaysError log method that will ensure that some errors
(like expired deprecation messages) are always printed.
Change-Id: Ia641f97b97258ea2826a1ad3fe2d7d7952ffa2ed
When we close an expired EME session, we can still get a key status
changed event. This fixed an assertion failure caused by this.
Fixes#1599
Change-Id: I49fd02151f8907c3868080e5c5dcd912fd25ecd4
- We can get a 'msneedkey' event with no init data.
- Use the correct message type name.
Issue #1689
Change-Id: Ic0e54fe8331d4700971d78095b77831de2d9580b
Fudge the append window end to fix a playback bug in Edge.
Because Edge does not seem to implement MP4 edit lists correctly, we
may end up with some audio truncation and a gap. If we fudge the end
of the append window a bit, we avoid this truncation and we get a
continuous buffered range and smooth playback.
Fixes#1597Fixed#1435
Change-Id: If28f3f5499dbf5ad9d33ee4859f95ebd91ad3e59
Refactor the closed captions support for HLS, using the same approach as
the closed captions support for Dash.
If closed captions are signaled in the manifest, player will create a
text stream for to represent the closed captions, and text engine will
store and append them. We don't need to set 'useEmbeddedText' value for
closed captions any longer.
Issue #1404
Change-Id: I9a5bf4df7e29d6e6982f29fd5e2df07bc78071d7
This fixes issues with the interpretation of URIs in HLS and makes
their usage and meaning consistent and clear.
- Name URI variables as either absolute, final (post-redirect), or
verbatim (exactly as they appear in the playlist)
- Identify media playlists by their verbatim URI when testing for
equality or duplication
- When a master playlist is redirected, interpret media playlists as
relative to the redirected location
- When a media playlist is redirected, request updates from the
redirected location
- When updating a media playlist, resolve media segment URIs as
relative to the latest redirected media playlist URI
- Resolve absolute segment URIs when parsing the playlist text,
rather than waiting until we intepret and build the manifest
- Remove some incidental bind() calls, which exposed compiler errors
- Avoid refactoring long parameter lists
- Avoid refactoring for async/await
- Clean up redirection tests, which were brittle and did not verify
what they seemed to
- Use relative segment URIs for all segments in tests
- Use media playlist URIs within master playlists in tests
- Add a regression test specifically for #1664Closes#1664
Change-Id: I45f946790c7d669637c231ae93920a09c18c4222
Now that we have a formal terminology for how we talk about
language and locales, this change updates our code to utilize
our new vocabulary.
For more information on our terminology, see our "Talking About
Languages" document.
While the expression of the behaviour has changed, the final
observable behaviour should not have changed. The goal of the
"rephrasing" was to build our logic based on the concepts discussed
in our "Talking About Languages" document.
Change-Id: I16c405e3d5a4d1e2275c99d5ec0bbdbaaf8373b9
Instead of Iterable|Iterator, just use Iterable. Iterators are, after
all, Iterable themselves.
Caught by a newer compiler/linter that we have not been able to fully
adopt yet.
Change-Id: I85c03a9193e6dc0b315b3bf30e70fe7be7c718df