Our support for CEA 708 closed captions only works if the container
video file is transmuxed. Because of that, we were not successfully
reading such captions on platforms with native TS support.
This change adds a configuration option to force TS to be transmuxed
even when unnecessary, to account for that situation.
It also adds an integration test to ensure that CEA 708 captions can
be extracted on every platform.
Closes#276
Change-Id: Id8b2a67f2327d1b69c9cdfc443e9592c99baf0db
This test has been flakey on OSX for quite a while, but it was very
occasional, and the likely cause of the flake is unrelated to the test
itself, so it was never really dealt with.
Recently, though, the test has been failing repeatedly on the BuildBot.
This change quarantines the test so that the BuildBot will stop failing.
Issue #1215
Change-Id: I1a721976c277cfb9324b0b3f9cf8eae49b17d1ca
- Translate uncaught Promise rejections into test failures
(Chrome only until the event is more widely implemented)
- Clean up uncaught Promise rejection caused by exceptions thrown
after destroy() in:
- CastProxy
- CastReceiver
- NetworkingEngine
- StreamingEngine
- Clean up uncaught Promise rejection caused by test cases in:
- CancelableChain unit tests
- DrmEngine unit tests
- StreamingEngine unit and integration tests
- Player unit and integration tests
- Speed up rejection in NetworkingEngine when we should not retry
- Add --delay-tests to test.py, to aid in debugging uncaught
Promise rejections and other types of async test pollution
Closes#1323
Change-Id: I5a8f5702a22430929babeb071bf6650c52c5ad17
This is an automated fix to be inline with Google style guides, this
was created with eslint's --fix option.
Change-Id: I860eecbc8152603e730aa17a1393f16d26b3b6fc
Google style guide requires adding curly braces to all block statements
even if it is only has one line. This fixes it by using eslint's
--fix flag followed by running clang-format to reformat the change.
Change-Id: Idc086c2aa8c02df5ef8b2140a11bfb9128eeb4bd
This isolates MediaSource code without changing the early
initialization of MediaSource, which was designed for low-latency
startup.
Prerequisite for #1087, #880, #997, #816
Change-Id: I61acedd95d73610d3e67436d9c7767d643fe2d29
This is part of a change to convert all usages of 'var' with either
'let' or 'const'. This takes a conservative approach for 'const' where
it will only be used for aliases and storing the "original" values in
tests.
Change-Id: I8f857a24e4c1ad336177d23dfed4f4a29d3262d2
A bug in our Promise polyfill caused issues with the recently-added
AbortableOperation class on IE11. Since external polyfills for this
are smaller, it is easier to remove ours in favor of a third-party
polyfill. Applications that wish to support IE11 must now load this
additional polyfill.
We are using the "es6-promise-polyfill" module from npm, but any
compliant polyfill should suffice.
One feature our own polyfill offered was the ability to flush all
Promises, which allowed us to write synchronous unit tests that
simulated async processes. To get this ability back, we are now
using the "promise-mock" module in our tests.
Getting "promise-mock" to load correctly involved switching from
"requirejs" to "cajon", which builds on requirejs and supports
AMD modules more directly.
Closes#1260
Change-Id: I5de48e88a910736ae5c1897a7a509bc5641acb70
This replaces checkWhatever type functions, which are called at the
start of a test, with checkAndRun functions, which are a wrapper
around the test method. This change standardizes our tests, since
checkAndRun functions are used in the db engine tests but not
elsewhere.
Change-Id: I74c7ac6836bbaab15b57fd480dbd6105ddc5ee60
When casting, the cast dialogue contains information about the current
media, including volume, time, and duration. These values are
synchronized by different messages. We were sending over the
MediaStatus messages that synchronize current time, but were not
including duration in our MediaInfo messages. This caused the cast
dialogue progress bar to not display correctly.
This change makes it so that our MediaInfo messages now include
duration, and we now send over MediaInfo messages in situations where
we did not previously.
Closes#1174
Change-Id: Ic585f3befec9e44ef4e9895d04ddfad6cc5473b3
This digests and organizes many of the automatic settings in eslint,
and changes several of them to be more strict. This also fixes the
following errors:
- array-callback-return
- no-catch-shadow
- no-multi-spaces
- no-new
- no-throw-literal
- no-useless-call
- no-useless-concat
- no-useless-return
Several checks have been organized into a group of checks we should
use, but need more time to implement and fix. Some other checks have
been delegated to the Closure compiler, which can more precisely
whitelist exceptions.
Issue #1157
Change-Id: I8fe4966959e08050f8159e6a1fee161e7d71177e
Not all values need to be updated twice a second. This change modifies
the list of player getters so that each value also includes an update
frequency, and only updates that property once in that many updates.
This acts as a configurable way to ensure that some properties update
in different amounts, without having to have multiple update timers or
compose multiple update messages in the same timeframe.
Change-Id: I90e75e3e73f6c633d91b1799307ec2b15587327b
getManifest() hugely increased the message size when casting, to the
point where we were having message size problems.
This CL stops that property from being proxied.
This also adds an integration test that makes sure update messages do not get
too large.
Closes#1128
Change-Id: I3c4bfabb4d35ee870a603c38f784cb226366a28b
Clean up several small things in the new integration test:
- Do not use the _compiled suffix in test streams, since this test
does not run against the compiled version of the library
- Append the video element to the document
- Set up wrappers in the order in which they will execute
- Send the init message only after all other setup is complete
Change-Id: I62488474e83c44923ace9c533449794d62bc0f6f
Because we mocked out canDisplayType to return false, and because that
is actually used on Chromecast in the MediaSource polyfill, this
caused the receiver integration test to fail with
CONTENT_UNSUPPORTED_BY_BROWSER. Because nothing was listening for
errors, this error was shown only as a timeout.
This fixes the mock and listens for errors.
Change-Id: I05a62c439666cfe1a282aa523a75e362e1674a4b
This adds a single integration test for cast receiver, as well as a
framework for adding more in the future.
This particular test pauses at each stage in Player.load where the
player could theoretically be polled to compose an update message, and
waits for an update message to be polled. This should help catch any
further null exceptions in the cast receiver that prevent update
messages from being sent out.
Issue #1162
Change-Id: If24486dd821275ab674960e559bd6d10776955a7
The cast sender API doesn't seem to be able to re-use an existing session
unless you reload the page. This stores the old session, so that it can be
re-used without reloading the page.
In order to enable this, CastProxy.destroy no longer leaves the current session;
I figure if you want to leave the session, you'll call forceDisconnect.
That part I am not fully sure about; perhaps it would be better to have a
separate optional argument about whether or not to leave, or make it a part of
the forceDisconnect argument.
Issue #768
Change-Id: Ie648372cea4b106ff85df3d0dcc563fca5d10d8c
Beforehand, calling chrome.cast.session_.destroy() would typically cause an
error, as the message or update listener was called after the the CastSender
was destroyed.
This removes those listeners before destroying.
Issue #768
Change-Id: I7889adce7b829c3f24dac7a178c9be26e2fdc887
If you call chrome.cast.initialize a second time, it does not error but it
also does not fire off receiverStatusChanged in order to signal the
initial receiver status. This can result in problems if the CastProxy is
destroyed and then re-created; specifically, it will erroneously claim to be
unable to cast until the receiver status next changes.
This makes hasReceivers_ into a class variable, so that a new sender will use
the hasReceivers_ of previous ones.
The original bug report was kind of confusing, so I cannot say for sure if
this actually solves their problem or not. Hopefully it does.
Issue #768
Change-Id: I7839ed99a8c48c69567bbcaeb1f9b6728265d63b
Beforehand, the Chromecast would poll getPlayheadTimeAsDate and
getPresentationStartTimeAsDate for every update message, which are live-only
getters, even on VOD.
This would cause a lot of error messages in the debug output of the receiver;
we didn't notice this before because we mostly run the receiver in compiled
mode.
This also allowed users to poll those attributes for VODs without any error
messages when casting, since the results of the last update were cached.
This change adds a list of getters that require live; such getters are not added
to state update messages, and are set up with asserts in the sender.
This should solve the problem and slim down our update messages a bit at the
same time.
Change-Id: Ifc0b445def2d85b22fcb9af160dec2205d1faace
Previously, if you connected to a ChromeCast that is currently playing, the
local interface would continue to show play icons as though the video was
paused.
This makes it so that the cast proxy sends out synthetic play or pause events
after the first state update after joining an existing session.
Change-Id: I1eb4c23f7b58225d361d353aacf0743def2f576c
There was a bug in the cast_utils test that meant that the new members
on Player weren't being detected. The test should fail when we forget
to add a new member to the list in cast_utils.js. This updates the
test and adds the new members to the list.
Change-Id: I27c25d07b409b8350b5709c3ce26696d72a6a11d
Some platforms (such as Chromecast) support extra MIME parameters like
framerate, bitrate, width, height, and channels. Since other
platforms will ignore these extra parameters, we should always query
using these parameters.
This introduces the framework to construct these "extended" MIME types
from Stream objects. Extra parameters for other platforms can easily
be added later.
Change-Id: I8936ca93e84068da18f12127fbc8fc1a0646695a
The getTracks and selectTrack methods have been deprecated since v2.1
and scheduled for removal in v2.2.
Change-Id: I938b3015262d71683ac871c05a9f4c74c96acf50
This is part of adding a new conformance rule to add additional type
safety. This will disallow using properties of unknown types or using
unknown properties.
The first parts will be fixing errors caused by the new rule. These
are backwards compatible, so can be applied before the rule is enabled.
Once all the errors and bugs are fixed, the rule will be enabled.
Change-Id: Iefde089b2f62ddfdf43944cda5badab438577561
The old definition using a union with a Function causes problems. The
compiler tends to treat this as an unknown type, so we loose type
safety. The new types ensure full type safety, at the cost of needing
to "convert" the spy when it is used as a function.
Change-Id: I98ebd9dffd9cb865d0cf5d03db0fb5d6ea001ed3
Somehow, errors thrown by CastReceiver unit test setup caused DRM
tests on IE and Edge to fail. This cleans up the Cast tests to fix
these uncaught errors that somehow polluted the DRM tests.
Change-Id: I435ff994b0b70199eb5a8febd419296b59497920
Media Playback messages are used by generic Chromecast controllers
(Google Home app and the likes). Supporting them is required by
the Chromecast SDK.
Closes#722.
Change-Id: I3c98fb9d63da81b59c2cc82a3e790332fc9bb56e
The text parsers were all stateless. This caused problems with MP4
VTT as the timescale is needed later on for other boxes. This changes
parsers to carry state.
How time is referenced with the text parsers is not clear and has
caused confusion. In v2.0.1, we introduced the useRelativeCueTimestamps
option to control the behavior of our WebVTT parser. We decided in #480
(comment) that we would remove this option in v2.1.0. All WebVTT
timestamps in v2.1.0 will be relative to the segment time. This change
creates a new time context interface that will be used to help limit
the confusion around how time is communicated.
Closes#726
Change-Id: I67409608c35d2d5abb8b8b25529859cb37f8f0a8
This adds a severity field to Error objects. This can be used to
detect whether an error is recoverable. All the same errors are still
reported so the field can be ignored.
There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
load() again
Closes#564
Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
This adds a method on Player to get the license expiration times for
the current EME sessions. This also adds the expiration times to the
stored content structure for offline content. This will update the
stored expiration while playing content (e.g. license duration changes
when playback starts).
Closes#727
Change-Id: I18770a79413423695bbb2ed5f31f6b19038a33d2
There were two instances of tests not cleaning up correctly. The
Dash Live tests didn't uninstall the Promise polyfill, which breaks
Promise.resolve for tests that don't expect it. Also, in the
CastReceiver tests, it defines a property on window. It needs to be
configurable, otherwise it cannot be set twice. Somehow the resulting
exception is not being caught by jasmine.
Change-Id: I0691a7bcddf14fd455f034d63e12fc8046044750
There are several tests that use fake <video> elements. All of them
have a createMockVideo method. This consolidates all of them into a
fake class that also provides more type safety.
Change-Id: I132c3e4a75676594bcefb60d0b115c00ede03067
Add UI options to select current audio and text language.
Split selectTrack() into selectText() and selectVariant().
Stop automatically disabling ABR manager when a variant is selected.
Add a warning if selectVariant() is called while abr is enabled.
Issue #412.
Issue #626.
Change-Id: I15f1c3c4fdc6d6b641f708fbef19dbcf10cbcfc6
MediaSourceEngine integration tests were failing on Chromecast due to
pollution of global state by CastUtils tests (video element not
removed, MediaSource object leaked). By fixing the clean-up in the
CastUtils unit tests, MediaSourceEngine integration tests are now
passing on Chromecast.
This also makes the video clean-up in MediaSource and StreamingEngine
integration tests consistent with the way the library cleans up video
elements in Player.
Change-Id: Id49d40ba1970040c0dd1fc342f2657fc3f5a24b8
Using a special API available on the Chromecast, determine if we can
do 4k. If so, raise the hardware limit from 1080p to 4k.
Change-Id: I6e403cce5d9c43a22f1b76cf4d79661ac096dd82
The emsg, loading, and unloading events were present in v2.0.0.
The drmInfo, isInProgress, and keySystem method were also present in
v2.0.0. The getPlayheadTimeAsDate method was introduced in v2.0.1.
None of these were proxied to the cast device until now. All v2.0.x
events and methods are now being proxied.
Change-Id: I6fba60f4ca451053c1449cafcddd9c1006292ad9
* Add config option for using segment relative timestamps for VTT
Fix for #480
* Make useRelativeCueTimestamps a non-nullable param
* Update tests for the new useRelativeCueTimestamps param
* Move period relative timestamp deprecation warning to vtt parser
* Log warning only if using absolute timestamps in text cue
* Fix vtt text parser test
Show 'stop casting' dialog on chromecast control click when casting.
If user chooses to stop, delegate disconnecting to Chrome.
Related to #261
Change-Id: I3072a3723e0d0d526039946fb45713e20349e54c
All tests now have the same timeout value. This should simplify the
process of addressing timeouts on Safari.
Change-Id: I3b455bd639758007ec8b2b86ef236c56e919c15a
* Drop unnecessary type alternation in SegmentIndex unit tests
* Drop unnecessary bind in StreamingEngine unit tests
* Drop unnecessary expose annotations in Pssh
* Add comments about quoted access in cast unit tests
* Move afterAll() position in cast unit tests
* Make return type for PublicPromise constructor more specific
* Define a type for Util.eventLoop return value
Related to PR #421
Change-Id: I092a8ff366b4ac4ea868dd3f4fbe4e3d63a2167f