Commit Graph

29 Commits

Author SHA1 Message Date
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 64896d70b0 Use shorter license header
This reflects changes in Google's policy on JavaScript license
headers, which should be smaller to avoid increasing the size of the
binary unnecessarily.

This also updates the company name from "Google, Inc" to "Google LLC".

Change-Id: I3f8b9ed3700b6351f43173d50c94d35c333e82b4
2019-11-22 18:18:36 +00:00
Jacob Trimble fd0dc8a5cc Add utility for looping from 0 to n.
Closes #1518

Change-Id: I865f7a0311516d04ae84532dab873e1aaa31eb24
2019-07-10 21:23:22 +00:00
Jacob Trimble 5c35108cb8 Avoid integer for loops.
Issue #1518

Change-Id: I3ba3cb6a439264e823022b2a64e7cdbd265494c7
2019-07-09 17:11:49 +00:00
Michelle Zhuo 4f56bdab23 Convert transmuxer.js time_ranges_utils.js video_wrapper.js to ES6
Issue #1157

Change-Id: Ia93dd6022015db1d0aee9ce20a9e8ce63249c4e2
2019-05-20 16:51:55 +00:00
Jacob Trimble 0dd64074b9 Only allow one statement per line.
With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.

Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
2019-05-13 22:11:50 +00:00
Jacob Trimble c81389741f Prefer const over let.
A coming update to the Google eslint config will require using "const"
over "let".  This makes that one change to isolate the big changes.

Change-Id: I7d0974c3ae15c53cc45a6b07bf9f6586e2d34aca
2019-05-08 09:22:10 -07:00
Theodore Abshire e5b2428c6f Also use large gap threshold on Chromecast.
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
2019-01-04 03:50:26 +00:00
Aaron Vaage c559898f83 Update getGapIndex threshold comment and logic
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
2018-12-10 22:10:30 -08:00
Aaron Vaage 4167b1658b Isolate Platform Checks
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
2018-12-11 05:43:52 +00:00
Michelle Zhuo 1b150eef04 Don't clear buffer with a small gap between playhead and buffer start
When the video is looping and there's a small gap between the playhead
and buffer start, we should jump the gap instead of clear the buffer and
download it again later.

Change-Id: Ieead1462ac8c1cfcc957c391a61890396b870d40
Closes: #1459.
2018-07-23 21:47:50 +00:00
Jacob Trimble 759eef9685 Change goo.gl links to bit.ly.
https://goo.gl is being turned-down, so we can't use it for new URLS.
So we have consistent short links, this converts them to be
https://bit.ly.

Change-Id: I07a86cba807b67157664893341f648023918d0de
2018-06-22 20:20:00 +00:00
Sandra Lokshina 8065bd54a8 Change namespace from shakaExterns to shaka.externs
Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae
2018-04-11 17:26:26 +00:00
Theodore Abshire fca48ea304 Typo fixes and rewording in comments, part 3
This makes a large number of small typo fixes. It also rewords a
number of comments and JSDoc descriptions, and does some
formatting standardization.

This doesn't fix every single issue, but it fixes a lot. Notably,
there were some formatting issues I declined to standardize due to
ambivalence on what the proper standardization would be; for example,
when and where empty lines should show up in JSDoc.

Change-Id: Ibce58f022b79de5efd5c0f3d5ab40a6042055b3f
2018-03-15 10:12:34 -07:00
Jacob Trimble 624acc66b8 Add curly braces to all blocks.
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
2018-02-21 11:23:34 -08:00
Jacob Trimble b2bde18a3d Convert 'var' to 'let'/'const' (5 of 9).
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: If4792c1bd3d5a82c24a4b2f0f84790d4eed22e67
2018-02-20 11:26:46 -08:00
Jacob Trimble b4d4294efc Add Player method to get buffered ranges.
Change-Id: I8237dc1d0b42a1d96bbd51cbd1c02ff58dd372f4
2017-10-17 16:24:53 +00:00
Jacob Trimble ca64053118 Fix test timeouts on Tizen TV.
Tizen TV seems to stall when it plays into a gap.  This stall isn't
fixed by a seek.  So when gap jumping, we should jump before we hit
the gap on Tizen.

Fixes: 62628840
Change-Id: Iff7b7a2a4c2c2a5b9015728f1dceece6421463b9
2017-06-16 20:45:19 +00:00
Jacob Trimble e5ce395f37 Implement gap jumping.
The bulk of the logic for gap jumping is handled in Playhead.  It
tracks the current buffered ranges and jumps over any gaps that appear.
It listens for a special browser event ('waiting') for when the video
element runs out of playable frames.

This change also removes the logic for jumping gaps at the beginning
of the timeline.  This is handled by the more general gap jumping
logic and works cross-browser.

Finally, this updates the buffering logic to only count the amount of
content buffered (i.e. ignoring the gaps).  This fixes some bugs where
gaps in the content can result in StreamingEngine buffering forever
since it thinks only a little is buffered.

This includes full implementation of the logic, but this doesn't close
the issue since there aren't any integration tests yet.  Those will
be added next.

Issue #555

Change-Id: Id99eb9fe469e8cf2c7464a3d70c3733791e806e0
2017-04-17 18:15:23 +00:00
Jacob Trimble e7ce5a7f35 Allow small gap at start when buffering.
We allow small gaps ahead of the playhead in StreamingEngine.  But this
is not mirrored in Playhead.  We should exit a buffering state even
when there is a small gap.

Note this is unrelated to the issue where Chrome won't jump gaps after
a seek.  In StreamingEngine, we don't allow this gap when seeking;
however, this change involves normal playback and doesn't involve that
bug.

Change-Id: If091994ee1a93965836e99cdb41873afb18d0fd4
2017-03-22 21:22:24 +00:00
Joey Parrish 56e493f446 Tolerate larger gaps at the start
The buffering watchdog should not block playback for small gaps at the
start of the media.

Closes #579

Change-Id: I4673d17d4433903f92b2fe3be5da0e14b48f7bdb
2016-11-15 21:13:23 +00:00
Jacob Trimble 7f7e6d7568 Workaround bug in Edge buffered ranges.
It is possible for the SourceBuffer buffered ranges to return a
(small) negative value.  We should treat this as 0.

Closes #530

Change-Id: Ib36e3f4e5e4fdb9f51a7d6644f006b8f9791cc45
2016-09-29 12:48:23 -07:00
Sandra Lokshina a81d6c5ce2 Ignore gaps up to 40 ms during buffering.
Browsers may or may not jump the same gaps during playback.

Closes #472

Change-Id: I5c1195f9818262b3faf9514633e523e40c859c6f
2016-08-25 22:26:15 +00:00
Jacob Trimble 28aac020a6 Add test networking scheme.
This allows integration tests to test Player and offline with "real"
manifests and segments that are generated using ManifestGenerator and
StreamGenerator.  The networking scheme can also be used with an
unmodified Player.

b/29883614

Change-Id: I77aa5385ecaaac43ba713687befa2f064654375a
2016-07-12 21:52:36 +00:00
Joey Parrish c6f7f66a25 Work around a Safari MSE bug
This fixes test failures in StreamingEngine on Safari 9.  Safari does
not completely remove ranges from buffer, even if the range
encompasses all buffered data.

Change-Id: If6c810655ab11632b10f8706f8ef0657679174c4
2016-06-28 22:43:28 +00:00
Jacob Trimble 19973d63f4 Changed copyright headers from 2015 to 2016.
Change-Id: I429ff27e4794c03b7ea392e38415075077f9bfb1
2016-03-15 16:32:13 -07:00
Jacob Trimble 846e7beb48 Unified comment spacing.
Before there were two style to indent comments after an annotation,
using 2 and 4 spaces.  Now this only uses 2 spaces.

Change-Id: Id06415d7193cc154a2768fb3932aff7a06b7ed32
2016-03-10 16:27:45 -08:00
Joey Parrish 6ae1474e65 Fix time range fudge value for Safari 9
In Safari 8, the necessary fudge is 1us.
In Safari 9, the necessary fudge is 1us + 1femtosecond.
This makes the fudge value 0.1ms.

Change-Id: I7184c2d1c28ccbd93bac137d6617cbd8999bcfb9
2016-02-16 21:25:12 +00:00
Timothy Drews a4ff2711f2 Add StreamingEngine and Playhead.
Closes #101
Closes #186

Change-Id: I8d1a8d6c0f8cfb5abdd81a149318377282b2bea0
2016-01-15 14:30:27 -08:00