Commit Graph

3137 Commits

Author SHA1 Message Date
Jacob Trimble 0f92d8221f Fix use of private tags.
Issue #1553

Change-Id: I8c0412eda3d68f2ad475bf8282afcaeffd80852a
2019-08-13 19:08:48 +00:00
Jacob Trimble 79aae2aeaf Fix protected member names.
According to the style guide, protected members should not end with
an underscore.  This renames them to fix it.  This also marks some
members as private that aren't used outside the class.  Lastly, this
fixes a possible bug with the use of "this".

Issue #1553

Change-Id: I6c7ecdcd228ec4e4aded4af52e2262d0bf5beaf4
2019-08-13 19:08:03 +00:00
Jacob Trimble 2d9285af3c Add <code> tags to Player extern docs.
This also adds a mentions the 'largegap' event.

Fixes #2097

Change-Id: I2ecf9f40a12f16741c1a01a455e70f3aaac62a5c
2019-08-13 19:06:48 +00:00
Theodore Abshire 37bc58d638 Still load tabs in noinput mode.
In noinput mode, we avoided loading the tabs, since they were unnecessary.
However, it turns out that we did need to load them if we wanted to load
custom assets, since they can only be loaded properly if the custom tab
exists.
This changes the demo to load the tabs, and just hide their contents.

Closes #2098

Change-Id: I2c4702fbaae3c88b44d86c7ac9e383728af42867
2019-08-13 17:27:53 +00:00
Jacob Trimble ce90a932e4 Fix spinner position on IE11.
When setting "position: absolute", you should set the "left" and "top"
properties to ensure it is aligned with its parent correctly.  IE11
apparently defaulted to aligning next to the video element.  This
ensures the spinner is aligned with the play button.

Fixes #2084

Change-Id: I91041813e36dbfd18a00c22af3f3f5d7e7542f40
2019-08-12 19:40:31 +00:00
Jacob Trimble d7fc19ab31 Allow filtering out failed HLS text tracks.
This adds a separate configuration value for this because (a) the HLS
parser can't access the streaming configuration and (b) this behavior
is different in that the streams are removed instead of just not playing
them.

Closes #2065

Change-Id: Ic9b1e0d40b161cd4ba0eb6d7c922882112034626
2019-08-12 18:16:28 +00:00
Jacob Trimble d1498f4968 Don't add Control event listeners multiple times.
Because configure() is called multiple times, we used to add some of
the event handlers multiple times.  For fullscreen, this caused us to
try to toggle fullscreen multiple times.  This changes to only add the
main event listeners one time and the DOM-specific ones have been moved
to be added in the configure() call.

This also moves the fullscreen toggle to the try so we can propagate
any errors from it.  Lastly, this adds an "error" listener to the
tests to fail the test.

Closes #2054
Issue #2089

Change-Id: Ic78417ce52cae1c53133b5a4217004bb91ebcc4f
2019-08-12 18:14:59 +00:00
Jacob Trimble e660667725 Make exported docs better for Player.
- Use <code> blocks.
- Use <p> to separate blocks (since newlines in comments are ignored).
- Use <ul> for lists.
- Give messages for deprecated tags.

Change-Id: I06d5e0e75eb3e498063cf0c291e6031af5d93b2d
2019-08-09 21:50:15 +00:00
Jacob Trimble 8fe79250c1 Fix seek bar coloring when nothing buffered.
You can't use linear-gradient() with one value.  The value will be
silently ignored and we will display the last buffered value.  This
fixes the buffering display to show that nothing is buffered.

This also makes the gradient construction more readable.

Change-Id: I1a93046ef51b70f94b170067b6c5ed2ae43ada1d
2019-08-09 21:18:36 +00:00
Theodore Abshire b8628b5032 Show full name of asset in search page.
Change-Id: I824473102eaf470ded96033f8801808a731c6412
2019-08-08 20:46:53 +00:00
Theodore Abshire f24c4a783f Added stylelint, a linter for our CSS/less files.
Also unified CSS/less style based on that.
This does have to use a forked version of stylelint, since there
is a bug (?) in the globbing library they use that causes it to
fail on our buildbot. I found the simplest solution was just to add
an option to disable globbing, a feature we weren't using anyway.

Closes #1867

Change-Id: I9295b01d5b15d060356e314938b64b551b75de6a
2019-08-08 18:38:19 +00:00
michellezhuo 1d417ff5ed HLS Refactor: Flatten createPeriod_() logic
Our previous approach:
For every variant tag, find the associated media tags(with the same
group id), create stream info for each media tag, and then create stream
info for variant tag based on that, and create variants.
This approach has duplicate calls for the media tags with the same group
id to create stream infos.

New approach:
1. Get codecs from variant tags
2. Create stream info from each media tag (with the codecs from variant
tags)
3. Create stream info for each variant tag, and then create variants.
This creates stream info for each media tag once, and avoids duplicate
calls to guess the codecs.

Issue #1558
Closes #2066

Change-Id: Icdf3133b1b15d1baf60624ff449e0a61fdb78d8a
2019-08-07 19:28:32 +00:00
Jacob Trimble c5b9d6804f Allow custom content ID in FairPlay.
Now there is a generic callback to transform the init data before
passing it to the browser.  This can be used by apps to use a custom
content ID in FairPlay content.  This also adds some utilities to help
in writing these functions and moves the default behavior to DrmEngine.

Closes #1951

Change-Id: I78ce660c126b53a69d5f55b16775ffcdbbe4d748
2019-08-07 18:38:40 +00:00
Jacob Trimble 438d599804 Parse Accessibility tag into text "kind".
Closes #2060

Change-Id: I916bbaf3357e9cdfbcfbfbafbd6dfc99890d7ebd
2019-08-05 10:27:59 -07:00
Jacob Trimble ad996d6873 Add tutorial for FairPlay support.
Closes #1951

Change-Id: I2dac43117ef444cf0701b2195d4a0e93385e5d52
2019-08-05 17:25:34 +00:00
Jacob Trimble e990da0179 Remove FairPlay formatting.
Now any formatting must be done by the app the same as other key
systems.

Issue #1951

Change-Id: Ifeaa0abdfda462cd457d19f6dce93c5af3a5fdad
2019-08-05 16:52:39 +00:00
Jacob Trimble b12075093e Add sessionId field to network request.
This allows a request/response filter to determine which EME session
made the request.  This also changes the session ID of FairPlay sessions
so they are available too.

Issue #1951

Change-Id: I1a07abae6faf4a87fad7b5d4290a00b25e83da8e
2019-08-05 16:52:11 +00:00
Joey Parrish 625938e2f9 Revert offline PSSH support for manifest that are missing inline init data
This reverts commit 6e5a0797de, #2042.

The PR as it landed broke some test cases and functionality for storing persistent licenses, and it doesn't seem to work even for its intended use case.
2019-08-02 16:56:24 -07:00
Theodore Abshire d85aff1491 Re-add MediaSession API.
This functionality was lost in the new demo page. This CL re-adds it.
This also fixes the MediaSession externs, which were incorrect; we
added demo typechecking after we removed MediaSession in the new demo
page, so we simply never noticed that.

Closes #1934

Change-Id: I177b80af70acd5211b7f39e6399965f3fdc696b6
2019-08-02 16:15:46 -07:00
Theodore Abshire 2765603cfe Fix scroll behavior on page load.
When an asset is loaded, the page scrolls to the top, so you can
see the video. When a tab is shown, the page scrolls to the top of
the tab, so you can browse it.
It turns out that, when you load the page, and it auto-plays an
asset, it loads the asset first, then shows the tab second. This is
because tab loading is triggered by an event, so it happens on the
next interruptor cycle.
This changes the load script to wait one cycle after dispatching the
event that triggers the tabs loading, so that the asset will be
loaded second instead.

Closes #2063

Change-Id: Icfb1a189d1c937afb849e5e584313001498c8c7a
2019-08-02 12:27:42 -07:00
Theodore Abshire ccd53ba170 Change progress bar to a circle.
This looks nicer, as the progress indicator is around the download button,
instead of being on the other side of the asset card.

Change-Id: If44cc39691664b95c05665665260c5938123cc4f
2019-08-02 18:58:12 +00:00
Sandra Lokshina a7716632d2 Don't create a UI if the app already has one.
If an app uses the shaka.ui.Overlay constructor to create
a UI before our auto-detection code runs, they end up with
two UIs one on top of the other.

I personally think anyone should be grateful to get an
extra UI or two, but people complain for some reason.

Closes #2073.

Change-Id: I793b5a7d8b5092a9b65426f5994019fde75bf957
2019-08-01 23:15:44 +00:00
Sandra Lokshina b4ddbd2131 Add mention of the Chromecast SDK to the UI tutorial.
Closes #2061.

Change-Id: I48396b8e5cd9ed821b25f5d87965ed7fd8e86691
2019-08-01 22:50:18 +00:00
michellezhuo 7faee6318a [UI] Fix text display css styles
In mobile fullscreen mode, the captions font size was relatively big,
and the captions overflowing out of video window got hidden.
This was because:
1. In full screen mode the font size was set 4.4% of window height.
Changing it to min(4.4% window height, 4.4% window width) should work
for both portrait and landscape screen.
2. css 'white-space:pre' hides the overflown texts. Should be
'pre-line'.

Closes #2051.

Tested with: Demo app, Angel One, Pixel2 in chrome simulator.
1. Load the video, turn on captions, enter full screen mode.
2. Rotate the screen to see the captions in both landscape and portrait
mode.
Before: The captions font is large, and the screen hides overflown
captions.
Now: The captions font is normal, and if the captions are long, it is
shown in a few lines.

Change-Id: I5c8c3aa900ee3623955b735f93647f1ca54e9a66
2019-08-01 20:43:55 +00:00
Joey Parrish 7fe97b841b Move fields to SegmentReference
To prepare for flattening out the manifest structure to remove
periods, this change moves initSegmentReference and
presentationTimeOffset fields into the SegmentReference object.  This
way, the segments on either side of a period transition or HLS
discontinuity can have different offsets or init segments, eventually
allowing us to create a single array of SegmentReferences for
multi-period content.

Issue #1339

Change-Id: Ic7eff0483789644881247ecf8044c5fb6a48f0e6
2019-08-01 11:04:36 -07:00
michellezhuo 524652f949 Fix hls live test
The variant tag's AUDIO attribute value should match the media tag's group-id value.

Change-Id: Ib942425ea1bdf37b4ff5f5a69158fc7ef5368b45
2019-07-30 13:03:22 -07:00
Shaka Player BuildBot 2ad32aa5b8 Merge remote-tracking branch 'github/master' 2019-07-29 15:57:34 -07:00
Jacob Trimble 5c580e243e Throw an error when FairPlay cert not set.
Fixes #1940

Change-Id: If911986eb70838b1aa81fc85f088c8367f7e1b48
2019-07-29 21:02:21 +00:00
Jacob Trimble 39f0d76a1f Don't enter fullscreen on double click on bottom bar.
Fixes #2053

Change-Id: I4779547ae2116d9cc4394c27aab33366ad36a6a6
2019-07-29 21:01:40 +00:00
Jacob Trimble 3b0367ec3a Exit PIP on unload in the demo.
When unloading content (e.g. when closing or when deleting offline
content), we should exit the PIP window and fullscreen.  This moves
these actions to the unload() method so they affect other sources of
unloads.

Fixes #2055

Change-Id: Ie1b5ac0f7cb814ff6bae3b08cc4c1fc80967d941
2019-07-29 11:23:17 -07:00
Theodore Abshire 2c51de2574 Re-added hidden 'noinput' param to demo.
Change-Id: I137fdaf04342f20c8e389340473d0994c527998c
2019-07-29 10:38:59 -07:00
Ante Wall 6e5a0797de feature: Offline PSSH support for manifest that are missing inline init data (#2042)
* fix: Reference issue with SegmentReference createUris

* test: Added Segment GetUris Test for timeline

* feat: Get PSSH from segements if not initdata exists

* feat: Get PSSH from segements if not initdata exists

* fix: JSDoc comments and moved drmEngine update to storage

* fix: Remove comments

* fix: Remove unused import

* fix: Lint erros and dedup initData code

* fix: remove no init data test and add check for use persistent license
2019-07-26 11:01:05 -07:00
Sandra Lokshina f33395eb83 Add the addBigPlayButton config to the tutorial.
Change-Id: Ief7c13490954539bf9784f1ecd3c7cc3d6b58e1b
2019-07-25 15:10:18 -07:00
Sandra Lokshina 635acb6ecf Extract the big play button into its own class & make it optional.
Change-Id: I462632c3da5f8ff5a68e111940591086bb395a13
2019-07-25 22:06:37 +00:00
Theodore Abshire 0b9de75617 Made close button on errors easier to click.
This makes the close (X) button on the error bigger.
It also makes the documentation link smaller; specifically, it makes the
link div only the size of the text, rather than the entire width of the
error bar.

Closes #2057

Change-Id: Icb7519daea4831edcc2f42cbb851a34356bc8548
2019-07-25 10:58:34 -07:00
Theodore Abshire 3a67802ce2 Fix parseFirstCue test on some platforms.
It turns out that, on some browsers, incomplete XML does not properly
parse. This means the parseFirstCue tests did not work on those platforms.
This modifies those tests on platforms that do not support partial XML;
when no support is detected, it instead tries to get the first cue
from a non-partial segment.
This also modifies the HLS parser to only load partial text segments if
the text parser supports it; otherwise, the hls parser will load full
captions in order to extract start times.

b/137945635
Issue #2037

Change-Id: I58112864a818baf155b365a65fba1c8a56eb9520
2019-07-24 11:23:03 -07:00
Sandra Lokshina 639005b124 Don't call mediaSource.endOfStream() more than once.
MediaSource throws if endOfStream() is called when
its readyState is equal to 'ended.' This happens if
endOfStream() has already been called.
This change ensures that we don't try to call endOfStream
on the MediaSource that has already marked as 'ended.'

Closes #2050.

Change-Id: I2672b297f0ebb7fd67afcf72ee52df6d5bacf761
2019-07-23 13:01:54 -07:00
Sandra Lokshina 7c271baba5 Communicate seeking state to controls.
Regression from fcbb725. Other elements rely on controls
knowing current seek state. Now that seek bar is its own
class, it needs to update controls on that.

Change-Id: I29ae8faa9f830ef86380d6b07373dedbeebce263
2019-07-22 15:47:51 -07:00
Sandra Lokshina a8aec9726f Fix fullscreen behavior on double click and rotate.
Enter fullscreen on dbl click behavior got lost after
the UI lib redesign. Also, rotate to fullscreen should
not be conditional on the layout having a fullscreen button.
There might be no button, but we should still enter
fullscreen on rotation for applicable devices.

Closes #2043

Change-Id: Ic75738cdd429851945acb5201780d9d73a6faadd
2019-07-22 21:01:54 +00:00
Sandra Lokshina aa089a5c19 Fix 'caststatuschanged' event name in pip button.
Closes #2044

Change-Id: If288d46fe2b01dc613537d044a587195d3115991
2019-07-22 18:21:45 +00:00
michellezhuo 292af90b7c Remove duration from StreamInfo
Change-Id: I72548e0ddb567afa3f0fc88883f8cad035398c59
2019-07-22 17:08:28 +00:00
Joey Parrish 51a3789ca0 Update karma-webdriver-launcher
This updates karma-webdriver-launcher.  The new version has an updated
"wd" module dependency and additional debugging information which was
helpful to us in addressing a problem with our testing infrastructure.

b/137548763

Change-Id: Id7fbe53a4c11ff09804a74616791b2e77028386e
2019-07-22 16:47:17 +00:00
Jacob Trimble 38442986e0 Error when excluding core files.
Fixes #1761

Change-Id: If06d4945be693e83bafb6317988b477ec4f610cc
2019-07-22 15:53:04 +00:00
Joey Parrish 124ab33727 Fix custom asset test
This is not run regularly or by default, and many things about it were
broken since the last time we paid attention to it.

The DRM checks were broken in the demo app refactor for v2.5, and
other parts were broken for even longer.

Change-Id: I053f2615a749e7e7d6252f689d16c50b99cf94ff
2019-07-19 15:59:13 -07:00
Jacob Trimble e909a0a67f Update changelog and bump versions for v2.5.4
Change-Id: I2fae964dbe3cdde850f8349bd992827ae44a6e5f
v2.5.4-master
2019-07-19 17:07:55 +00:00
michellezhuo fd326951c5 Small refactor of Hls Parser
1. Make createPeriod_() and createVariantsForTag_() clearer to read.
2. Simplify and remove duplicate code.

Change-Id: Idda7cb40f33905afd9512d427d7e78cb6c96ede9
2019-07-18 22:11:28 +00:00
michellezhuo 7c404c0cca Remove SegmentIndex from StreamInfo
Since streamInfo has stream and stream already contains segmentIndex, streamInfo doesn't need it.

Change-Id: Idb8ef793abf06e1ee3538481bf9bde42e714815c
2019-07-18 21:03:04 +00:00
Ante Wall 3e752f98b5 Fix reference issue with SegmentReference createUris (#2040)
In a recent refactor that made some internals of DASH parsing async for the first time, we broke the creation of SegmentReferences by having createUris close around values that changed later.  This fixes the bug and adds a regression test.
2019-07-18 13:26:47 -07:00
Jacob Trimble 8a3f51de41 Allow multiple spelling matches per line.
Before, it would only check one match per line.  Now it finds all the
matches to ensure a correct spelling doesn't hide an incorrect spelling
on the same line.

Change-Id: Iee6c7fb617852bf858a27c1c2a19026be5d8d089
2019-07-17 15:50:46 -07:00
Theodore Abshire 1e12873fb7 Only parse first cue when getting text start time.
Previously, when the text engine tried to load the start time of
a segment, it would parse every cue in that segment, then check the
time of the first cue. This was judged to not be a significant
performance issue, as parsing cues is a fast operation. However, it
did have an unintended side-effect: in some situations, this method
was being passed partial segments; notably, the HLS parser would load
the first 2048kb of the stream's texts to extract timing data.
If the caption parsers tried to actually parse an incomplete caption,
they would error.
This gives the text parsers "parseFirstCue" methods, and uses those
methods when it only needs the first cue anyway.

Fixes #2037

Change-Id: I2a1fb2f1a96d98967f0c6e6a5c277914a28b42ad
2019-07-17 21:27:32 +00:00