Commit Graph

3764 Commits

Author SHA1 Message Date
ismena 5915f469bd docs: Update the way to change seek bar colors in the tutorial.
Issue #2708

Change-Id: I66982bc04c8e9358782e9a13b361b7803fe766dd
2020-07-09 11:08:39 -07:00
michellezhuo 5923388211 docs: Add native HLS playback in Safari in FAQ
Change-Id: Ibb8e96037521ea31546a8760220413592ba8d9a4
2020-07-09 16:52:57 +00:00
Álvaro Velad Galván 943bdb2b35 Use Network Information API to react to network changes (#2663)
Resolves #1067
2020-07-09 09:46:24 -07:00
michellezhuo 109973c7e2 feat(LL-HLS):Enable preload hinted segments
LL-HLS hints a resource that is needed to playback in the upcoming
update. It's available for request, and may not be available for
download yet.

A preload hinted resource is either a partial segment, or an init
segment. If it's an init segment, treat it the same way as the Map tag
in ManifestTextParser.
A preload hinted segment contains no duration information, so its
start time and end time are the same. It will be replaced by a partial
segment in the next update.
We should fetch and append the preload hinted segment the same way as a
partial segment.

Issue #1525

Change-Id: I1e30f216ecdc843c3cd01681629a8886383d0b22
2020-07-08 22:11:06 +00:00
michellezhuo ec3bf7aaa5 fix(HLS): Fix discontinuity timestamp offset
Closes #2687

Change-Id: I60e41341d1149eb8200bec71fa1bafb5be8e57c7
2020-07-07 14:12:47 -07:00
michellezhuo 965ef453b6 feat(LL-HLS):Enable Partial Segments streaming
Changed SegmentIndex and SegmentIterator to iterate through regular and
Partial SegmentReferences.

SegmentIndex:
merge(): Find all the old segments after the first new segment's start
time, and replace the old ones with new segments.

SegmentIterator:
Use the currentPosition and currentPartialPosition pointers to iterate
through the two-layer arrays.
current(): Get the current SegmentReference, and get its current Partial
SegmentReference if it has a Partial Segment list. Move to the next
regular segment if we reached the end of the current segment's partial
list.
next():
If the regular segment has a partial list, go to the next Partial
Segment. If reached the end of the current partial list, move to the
next regular segment.
If the regular segment doesn't have a partial list, move to the next
regular segment.

Issue #1525

Change-Id: Icb7f49e50314f15ea40bf3a74d008191ed1a9a6c
2020-07-06 00:34:55 +00:00
michellezhuo 1685b2cd83 feat(LL-HLS):Enable playlist delta update
Player can request delta updates to reduce the transfer cost.
Client: sends a request for playlist update with '_HLS_skip=YES'
parameter.
Server: replaces the older segments in the media playlist with
'EXT-X-SKIP' tag.

Issue #1525

Change-Id: I3643641d0cb97444ba1c00f06d9e113acba7b824
2020-07-06 00:33:06 +00:00
Muhammad Haris 480d4a801a Parse CEA-708 Packets from Fragmented MP4 streams. (#2660)
This is an MP4 Parser which extracts CEA-708 packets from Fragmented MP4 streams.

The Closed Caption Parser (shaka.media.ClosedCaptionParser) will own this MP4 Parser, and will initialize it and call it as shown. As data comes in, the parser will parse this data, and the caption packets data then be returned in a callback (on708Data), as shown. Here, a theoretical decoder (future pull request, mentioned as a Todo comment) will decode and extract the parsed captions from these packets.

Issue #2648
2020-07-05 16:29:17 -07:00
michellezhuo fb43b1f0fd feat(LL-HLS):Add support for Server Control Tag
For LL-HLS, use the value of 'PART-HOLD-BACK' in the Server Control tag
as the default presentation delay.
'PART-HOLD-BACK' is the server suggested min distance from the live
edge, and must be >= 3 * partial segment target duration.
It's always available when the playlist contains partial segments.

Issue #1525

Change-Id: I176188dbd39be0d038eee938d3e8358e54b8a3a8
2020-06-30 02:55:54 +00:00
michellezhuo bb1f844ce7 docs: Move Tutorial links up front
Change-Id: Ic47c50e01e3a7352253a43271c5f75e88c5d3048
2020-06-29 22:31:35 +00:00
태재영 7ab9031248 docs: change promise then to await (#2693)
Closes #2544
2020-06-29 14:24:23 -07:00
태재영 dd48cef08f docs: change variable declaration to modern syntax (#2692)
Issue #2544
2020-06-29 14:06:25 -07:00
michellezhuo c7fcae8136 chore:Minor update in the Question template
Change-Id: Icffdf42519c9a4d5ec815bd28ef30de08a7dcf4f
2020-06-26 14:21:29 -07:00
michellezhuo 35beefeb38 chore: Add tutorials link to the Question template
We're getting more questions, and some of the answers are covered in the
tutorial and API docs.
Adding a link to the tutorials page, to encourage people to check the
tutorial before asking a question.

Change-Id: I3d04938666e1c9fa818146517018aa7334c022b7
2020-06-26 21:17:18 +00:00
Muhammad Haris d53fbaeeeb fix: Fix disappearing captions with certain input patterns (#2674)
When the subtitles are turned off, unloadTextStream() on streaming engine is called, but currentTextStream is never set to null. When the captions are turned back on, a check in player.js sees that the current text stream is not null, so it assumes it exists, and is ready to go. Thus captions are never loaded.

Clearing (setting to null) the current stream on unloadTextStream ensures the text stream is properly initialized the next time it is called, and in a state so that captions can resume being parsed.

After further investigation, it seems that the unit tests are written in a way that assumes that the text stream is nulled when unloadTextStream is called. So this fix is definitely something that we assume already happens.

Closes #2671
2020-06-24 13:12:09 -07:00
Muhammad Haris d383047de1 fix(CEA): Fix missing captions when switching streams (#2672)
During video playback, if the user switches the caption stream (e.g. CC1 to CC3 which changes languages), the first caption in the next fragment is missing.

In fragmented MP4s, the end time of a caption is determined by the start time of the next caption. Thus for the last caption in a fragment, the end time cannot be determined until the next fragment is parsed.

Before this fix: the clearing of the caption stream was being called from a chain of function calls originating from clearBuffer_() on the Media source engine. But clearing a buffer and resetting a caption stream are two independent operations. As a result, the caption parser was being reset (its buffer cleared) during video seeks, and during stream switches. This makes sense for video seeks, because the end time of the last caption in the fragment can't be determined if the entire presentation timestamp changes. However for stream switches, resetting the parser doesn't make sense. Clearing the caption parser during a stream switch would actually get rid of the last caption in that fragment (which wasn't emitted since its end time wasn't determined yet), and we would lose the data, causing the problem.

The fix is to reset (and hence clear) the caption parser during seeks, but not during stream switches.

Issue #2648
2020-06-23 16:40:35 -07:00
Theodore Abshire aa9fe1d049 fix(demo): Fix behavior when UI fails to load
This modifies the demo to load localizations even when the UI fails
to load, so that the footer links will still be visible.
This also makes the footer links work in that situation, and modifies
the shaka-ui-load-failed event to return a failure reason code, so
that we can display a contextual error message in event of a failure.

Closes #2669

Change-Id: I0cf38f7e39558f1977eee490131378c32105437f
2020-06-23 23:29:37 +00:00
ismena 2386d4ea99 feat(Ads): Proxy all CS IMA events through the ad manager.
Change-Id: Id66c5ab5287ed99d7847ac6279e1b49284aef2b6
2020-06-23 20:19:03 +00:00
Sandra Lokshina 00942069d7 Fire a shaka.Player.Metadata event on detecting ID3 metadata.
Issue #2592.

Change-Id: Ia2a98668a5971071adfa0ee4d987337ea9c10c59
2020-06-22 18:18:36 +00:00
Joey Parrish 4ae1a4d3c5 chore: Update roadmap doc
Issue #2505

Change-Id: I2fe0a879ef6efa60cf8182de0db6dc5892a030e8
2020-06-19 00:36:36 +00:00
Joey Parrish 8af7896b07 chore: Append license for language-mapping-list
An internal automated tool at Google flagged that our LICENSE file did
not include information about the license of language-mapping-list,
which we forked and imported from
https://github.com/mozilla/language-mapping-list .  This corrects the
issue by appending the copyright and MIT license from that project to
our LICENSE file.

Change-Id: I8c93320572b2b21f04c176bede855d674a8c86df
2020-06-18 12:52:00 -07:00
Joey Parrish 136734a669 chore: Update changelog for v3.0.1
Change-Id: I5d7ec4adb8bcad52975bbba1e5915096ed4178c3
2020-06-18 18:56:12 +00:00
Joey Parrish 15d13c1dd7 test: Add missing Android screenshots
The Android device in our lab exploded and had to be replaced, and in
the meantime, new screenshots were added to the repo.  This adds the
missing screenshots so that the layout tests can pass on Android.

Change-Id: If82042d6b5d5c425108337d22fce938f339f2311
v3.0.1-master
2020-06-18 09:47:55 -07:00
Theodore Abshire 34337ca28d feat(UI): Added polyfill for screen.orientation.
There are some platforms (e.g. iPad) which can be rotated,
but do not support the screen.orientation API. This is relevant
because iPad now supports requestFullscreen, which it did not
before.

Found while investigating #2653

Change-Id: Iacc93433aa1fb50a25d968203dc9fd4f7f16b4ae
2020-06-17 12:31:24 -07:00
Álvaro Velad Galván 8f36ae50ec Add support for EXT-X-SESSION-DATA (#2642)
Resolves: #1460
2020-06-17 11:48:17 -07:00
michellezhuo 213e00c586 feat(LL-HLS):Use partial duration as update period and delay from live
In low latency streaming mode, EXT-X-PART-INF tag provides the target
duration of Partial Segments. It's required if the playlist contains
Partial Segments.
1. Get a playlist update every Partial Segment target duration.
2. Set the distance from live edge as 3 * Partial Segment target
duration, if not configured.

Issue: #1525
Change-Id: I8770f2be30f510ec143672411da0624801d48f4e
2020-06-17 17:09:32 +00:00
michellezhuo 244ebacac3 feat(LL-HLS): create SegmentReferences for Partial Segments
If a segment has partial segment tags, create a SegmentReference for
each partial tag, and add the list of partial SegmentReferences to the
parent SegmentReference as an attribute.
If the parent segment contains the segment tag(EXTINF tag), use the
duration information from EXTINF tag to create the SegmentReference.
Otherwise, calculate the parent segment's duration based on the partial
segments' durations.

Issue #1525

Change-Id: I946cc007aad2ff911b69bf1c6a46df145452bfaa
2020-06-17 17:09:23 +00:00
Joey Parrish 810f09ff1e fix(DASH): fix failure with identical text streams
The period-flattening algorithm is run even on single-period content
if the manifest is dynamic, because we don't know if another period
will be added later.

As a failsafe, we should create one output per input for single-period
content, and we can ensure that no streams are unused by marking an
input stream as the "best match" for an output if they share the same
ID.  That way, even if all other characteristics for two inputs are
the same, the input-to-output mapping for single-period content will
always be sane.

That ID-based logic was missing for text streams.  This change
corrects that.

Closes #2646

Change-Id: I28c6c63d92bcf710ae0072783911f9e66ed78228
2020-06-17 16:12:00 +00:00
ismena a2554364ee feat(Ads): Expose more client side IMA info to apps.
In particular:
- New ad events were added
- It's now possible to get original IMA ad and ad manager
objects through Shaka

Change-Id: I2ffdc08befc11011673ebba5fb2fdb5e485977f5
2020-06-17 15:39:11 +00:00
Theodore Abshire 6694d3c13e feat(UI): Add forceLandscapeOnFullscreen UI config
This is a UI configuration that forces the device to orient to
landscape mode when the video goes fullscreen.
It may or may not work on all platforms, due to being based on an
experimental browser API.
It is true by default.

Issue #883
Closes #2653

Change-Id: I947bfb84e77f65b38bcf8a1572d70a04a3073ba0
2020-06-16 21:22:48 +00:00
michellezhuo 76c4c674dc feat:(LL-HLS) Parse Partial Segment tags
Low Latency HLS uses 'EXT-X-PART' tag for Partial Segments.
ManifestTextParser will parse the Partial Segment tags, and add them to
the regular segment after them.
If a list of Partial Segment tags is being published and doesn't have a
regular segment Uri following it yet, create a segment object to wrap
the Partial Segment tags list.

Issue #1525

Change-Id: Ie04ed70ae15c88416d677d67b721f76bc2f5b486
2020-06-16 04:06:52 +00:00
Muhammad Haris e8f24ece6f Created MP4 Box parsers to parse data for common box types (#2649)
Issue #2648
2020-06-15 17:35:38 -07:00
Joey Parrish 74d9f031e1 chore: Update mux.js
The new version has license headers, which means mux.js release
bundles now comply with some internal Google policies, which in turn
simplifies some of our internal release procedures for Shaka Player.

Change-Id: I796775231c2be2b252d7cbd7adce5d4002e4df76
2020-06-16 00:17:16 +00:00
Joey Parrish 53b6e40c6d fix(offline): Fix progress callbacks in release mode
This works around an apparent compiler bug that caused the invocation
of our progress callbacks to be removed from the compiled output.  To
test for this, the existing progress tests now use the compiled
library.

Closes #2652

Change-Id: I5698cfe0a833696e9cd5c8f8851698e1e66ef901
2020-06-16 00:09:39 +00:00
Joey Parrish f86e7208ee style: Re-enable the prefer-spread eslint rule
The prefer-spread rule to prevent use of apply() was disabled, but we
had another custom rule that also prevented the use of apply().  This
re-enables the standard rule.

Issue #2639

Change-Id: Ic3778d7267deb6cd5ed49282ea43bb84ad076060
2020-06-15 23:53:39 +00:00
Joey Parrish 486123ce41 fix(DASH): Fix bad segment URLs in SegmentTimeline
When Representations have different BaseURLs, segment URLs generated
for SegmentTimeline were always using the BaseURL of the last
Representation because the wrong parsing context was being used.  This
fixes the issue and adds a regression test.

This only affected v3.0.0.

Closes #2650

Change-Id: I04df950b5d3205e102f9c74f52ece9773ce92282
2020-06-15 22:40:48 +00:00
Joey Parrish 1ce2aa8c2a fix(demo): fix centering of MDL icons
Some icons on the demo were not centered correctly, such as the custom
content tab's "plus" button.  Some conflicting styles were changing
the line-height.

Change-Id: I08c9bb01642346b1a3b1162f779300221ae23246
2020-06-15 12:03:54 -07:00
Sandra Lokshina cda30283d2 Fix: fix UI not showing up for server side ad streams.
Apparently, IMA SDK adds their ad UI differently on SS vs
CS ad streams. The solution we devised for CS ad experience
that combined our UI with the IMA's native ad UI turned out
not to work for the SS experience - our UI was being obstructed
by the IMA's UI.
This change adds a new container for the SS IMA UI that allows
our own UI to stay visible.

Issue #2592.

Change-Id: Iedb24beeb8d6f777b1fd7f4155c591350432ec78
2020-06-12 16:55:33 +00:00
Joey Parrish f01d4edd94 fix(demo): Fix error text overflow
Some very long URLs can appear in the error text, and word wrapping is
very helpful.  This change sets styles on the element to wrap text
anywhere.

Change-Id: I9b1ddc97f90d5f1b2f5e532efd7c53f747576db5
v2.5.13-master
2020-06-11 15:14:53 -07:00
Joey Parrish a7e55404ee fix(demo): Fix missing icon for demo app menu
This icon went missing in the change "Apply upstream styles for icons
font" (Change-Id: I615c1dfd86e5b9802d03050c5db0154ac196c2ef).  We may
not be using that CSS class name any more, but the MDL library still
is.  So this override that was removed needed to come back, albeit for
a different reason than before.

Change-Id: Ibf7e865604f09d9d02fe15fe9f577ea63cdf6d1d
2020-06-11 15:14:44 -07:00
Joey Parrish 499ab77929 chore: Update changelog for v2.5.13
Change-Id: I1fae3a88387a638e808d010efe7fad5dc049d37a
2020-06-11 22:04:00 +00:00
Joey Parrish b84061a764 build: Upgrade the compiler
This upgrades the compiler to the latest release and fixes some type
errors in the tests found by the new compiler.

Change-Id: I3a555cbdfc94c51fb0683f8397c6adb8ea43f120
2020-06-11 22:03:47 +00:00
Joey Parrish 06fd3ce322 fix: Fix strict compiler errors
In our Google-internal build systems, with the strictest compiler
settings, we were seeing errors related to these two issues:

1. A missing require
2. Incomplete type info

This fixes the errors in that environment.

Change-Id: I9c4c482ed6ef8f669e113263a70958b53138c4ee
2020-06-11 10:17:48 -07:00
Joey Parrish 606457488f fix: Add license header to generated externs
To comply with internal regulations, even our generated externs should
have a license header.  This prepends the header to all generated
externs.

Closes #2638

Change-Id: Idef8e7bff53363175aefa34274a8f71477e830fa
2020-06-09 16:19:55 -07:00
Joey Parrish c1b109aabc fix: Correct license headers in CSS/LESS
This corrects/normalizes the license headers in CSS and LESS files.
The LESS tool respects the same "/*!" syntax for forcing the inclusion
of a license header, but will not dedup these licenses.  So the LESS
files generally will not use this syntax.  Instead, the build system
prepends a license header after compilation.

The exception is for our SVG spinner, which is based on third-party
CSS from codepen.  The copyright header for this is forced into the
output to give proper credit to the original author.

Issue #2638

Change-Id: I4c58e2b082f2d5e550a6f0a30feaaf9ebf82a53a
2020-06-09 16:19:38 -07:00
Joey Parrish 13f3cc3922 fix: Force inclusion of third-party license headers
This forces the inclusion of the following license headers from
third-party code:
 - language-mapping-list (Copyright 2013 Ali Al Dallal)
 - goog-uri (Copyright 2006 & 2008 The Closure Library Authors)

The Closure headers have been shortened, since they use the same
Apache-2.0 license as Shaka Player.  The other license has been left
in its full form.

Issue #2638

Change-Id: Idea7c0f2cb9eb8039eeb3f64fe5cc27e7cb78006
2020-06-09 16:14:38 -07:00
Joey Parrish 7e6a0f38ff fix: Correct license headers in misc. files
This corrects/normalizes license headers in misc. files, such as
config files, docs, build tools, tests, and externs.  This does not
affect the compiled output, and is only done for consistency.

Issue #2638

Change-Id: I9d8da2de55243b08d7df2b743aac73c6f15e858a
2020-06-09 16:13:56 -07:00
Joey Parrish c9bd9a5dc9 fix: Correct license headers in demo app
Though not part of the library, this corrects/normalizes the license
headers in the demo app to be consistent with those in the library.

Issue #2638

Change-Id: I4546c4c6970d72ff71a37489fd582623bd6e2ca3
2020-06-09 16:07:06 -07:00
Joey Parrish f539147d48 fix: Correct license headers in compiled output
This fixes all the license headers in the main library, which corrects
the appearance of the main license in the compiled output.

It seems that the `!` in the header forces the compiler to keep it in
the output.  I believe older compiler releases did this purely based
on `@license`.

Issue #2638

Change-Id: I7f0e918caad10c9af689c9d07672b7fe9be7b2f3
2020-06-09 16:05:09 -07:00
Joey Parrish da79dbc5db build: allow forced license header syntax in eslint
The block comment syntax "/*!" is used to force a license header to
appear in the output of the Closure Compiler and other tools, but we
need eslint to allow it.

Issue #2638

Change-Id: I7a461ba0ffcdbdd588dbe60ca5629b5ccbdf2fed
2020-06-09 16:01:53 -07:00