Commit Graph

82 Commits

Author SHA1 Message Date
Joey Parrish 4d88905463 Build docs as part of build/all.py
Originally, docs were slow to build, and many people did not need a
local copy.  Now, building the docs is fast, and doing everything as
part of "all" is less surprising.

Closes #1421

Change-Id: I5ac254df9d2beca8c1c5898614782a81e662a0e9
2018-05-11 21:55:32 +00:00
Sandra Lokshina 1cca1d0ea2 Allow users to more easily set single config fields.
Closes #763

Change-Id: I1918f2a5286781e81f2619296e3201f02b91128f
2018-05-09 19:03:28 +00:00
Sandra Lokshina 8065bd54a8 Change namespace from shakaExterns to shaka.externs
Change-Id: I16432351e2a266aa8fd175669aa27c44bfdffeae
2018-04-11 17:26:26 +00:00
Joey Parrish 66abf9cb27 Remove all protocol-relative URIs
According to @beaufortfrancois, we should no longer be using protocol-
relative URIs.  He quotes this passage from Paul Irish:

> Now that SSL is encouraged for everyone and doesn’t have performance
> concerns, this technique is now an anti-pattern. If the asset you
> need is available on SSL, then always use the https:// asset.

> Allowing the snippet to request over HTTP opens the door for attacks
> like the recent Github Man-on-the-side attack. It’s always safe to
> request HTTPS assets even if your site is on HTTP, however the
> reverse is not true.

Source: https://www.paulirish.com/2010/the-protocol-relative-url/

This change was begun with the following command:
  git grep -l "'//" | xargs sed -i "s@'//@'https://@g"

Some changes made by that command were false-positives, which I then
reverted manually.  Others required additional cleanup to meet style
rules.

I've also just discovered that the "max-len" rule in eslint's Google
style config exempts URIs, so there's no need to disable the max-len
rule on URIs in the assets list.  These have been removed in the asset
list where unnecessary.

Finally, testing these updated URIs led to the discovery that two of
our third-party demo assets are no longer available.  One URI needed
to be updated.  The other had no obvious replacement, so it was
removed.

Closes #1390

Change-Id: I2fe23faec04f1904c1741236b364d5089900092a
2018-04-09 18:06:18 +00:00
Joey Parrish 6a02bd25d3 Update upgrade guides for v2.4
Closes #1342

Change-Id: I2cbb8933abe833afc74471efb6ad1e3e40bb1c28
2018-04-06 17:40:51 +00:00
Theodore Abshire f2244d1aa7 Added FAQ entry for forceTransmuxTS
Change-Id: Ibe090fb3224c192cf389caebc0bbfedeb449f4ae
2018-03-30 12:13:12 -07:00
Joey Parrish 0c217391c9 Add alwaysStreamText config
This will allow text streaming to work correctly with browser native
controls.

Closes #1332

Change-Id: If11ba67957babad8dea23759aab9004d891aaf6b
2018-03-15 03:49:44 -07:00
Joey Parrish f0a3dbe1e2 Update architecture diagrams
This updates the existing diagrams and adds new ones for cast and
offline.  The offline diagrams will need to be updated again after
we resolve #1248.

Closes #1197

Change-Id: I6b6b1fac732b4997c579f58c7f12f0f84f202380
2018-03-15 08:07:22 +00:00
Jacob Trimble bfb42c69c4 Make EME polyfills independent.
Now each EME polyfill can be removed independently; this allows
someone to remove just the IE11 polyfill while still keeping the
others.

This adds a priority ordering to the polyfills so the nop polyfill
will be run last as a fallback if there are no other polyfills.

Issue #1261

Change-Id: I865e1c0d6a73a079dd91505e96572e215e6f6c6a
2018-03-06 21:34:25 +00:00
Joey Parrish 86b323d6a1 Simplify linux prereqs process with a script
This adds a new script which should simplify the process of installing
prereqs on Debian and Ubuntu-based Linux distributions.  This also
updates the required versions of NodeJS and Git.

Closes #1175

Change-Id: If298cc46650bfd0ebe726c8fa3184dd0d063bfaf
2018-02-26 18:03:09 +00:00
Joey Parrish abb0e7e4d1 Recommend the use of the debug library
Instead of using the uncompiled library, which some app developers
have been confused about, recommend the use of the much simpler debug
library, which offers many of the same advantages.

Thanks to @jpmedley for pointing out the complexities of using the
uncompiled build.

Change-Id: I771a2b5a98152a67807629538d8537721177399f
2018-02-22 12:27:03 -08:00
theodab b4ca4bf51c Adds an HTTP/s scheme plugin using Fetch
This plugin is preferred over the XHR plugin, if available.
This plugin requires AbortController, which is only present on
Firefox 57 and Edge 16, so this will not be active on every platform.

This also adds a simple mock for the Fetch API for use with Jasmine.

Closes #829

Change-Id: Ifb79d29334fbfcfd175afe0706da5a3d5e452e2f
2018-02-08 23:11:53 +00:00
Joey Parrish 3dbf28ce39 Fix jsdoc linksource error on bad markdown escape
Issue #1259

Change-Id: I34fb3514b04087fb1389f64e3cb91eaf852af648
2018-02-01 21:55:01 +00:00
Joey Parrish df0d34ccf5 Add linksource tag to jsdoc
This is a customization that allows us to link to the source code of
a thing, rather than its documentation.

Redoing this in a clean way caught some bad links, which have now been
fixed.

Issue #1259

Change-Id: I4c63aa10ddad8f8f21b224668c3529c70a1c6756
2018-01-31 14:05:13 -08:00
Joey Parrish 82357486a6 Replace buggy Promise polyfill
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
2018-01-30 23:10:04 +00:00
theodab abf9f5ed08 Min bound bufferBehind with max segment size
When playing manifests with segments longer than bufferBehind, while
gap jumping is enabled, there can be issues where the streaming engine
evicts the frames of the segment currently playing, thus creating a
gap that is then jumped.
This change makes the streaming engine use bufferBehind or
maxSegmentSize, whichever is larger, when choosing when to evict
segments.
It also adds a getter for maxSegmentSize on presentationTimeline.

Closes #1123

Change-Id: I83459c5eb3ebb1d6dff031e2bc244ac9fc3b5763
2018-01-30 22:04:14 +00:00
Joey Parrish 2f55d2a3bd Use AbortableOperation in networking
This uses AbortableOperation in all networking, from the scheme
plugins all the way to the request interface.

This also updates all default scheme plugins, docs, and sample code.

Backward compatibility is provided for scheme plugins and the
request API in NetworkingEngine.  This compatibility will be
removed in v2.5.

Two cancelation-related tests have been disabled in
player_integration until the new abort interface has been adopted
in the manifest parsers.

Issue #829

Change-Id: I91c8e6efe97798d111e8ddca5655cddc1f6bcbf3
2018-01-29 19:23:47 +00:00
Joey Parrish e298fb60fc Update muxjs to use new keepOriginalTimestamps option
Depended on issue videojs/mux.js#168

Issue #1194

Change-Id: Ia2ad5c17ad82a2c53215d34fbfec7be1d119df95
2018-01-18 20:18:09 +00:00
theodab 27ffe4d23a Add an FAQ entry for handling file:// requests
Closes #1222

Change-Id: I5cb9dcb07d65d839aa4809faaea9bf2273c69c68
2018-01-16 15:03:55 -08:00
Aaron Vaage d8cc658606 Removed Extra </span>
In the offline tutorial there was an extra closing tag for
a span tag.

Change-Id: I4ac2691b362bcd2c8c9ff61d8faf4770a3e428e6
2018-01-05 10:47:38 -08:00
Joey Parrish 1a2c88745e Upgrade the Closure compiler to v20171203
Change-Id: Id0dd4619db0c3a141d60e9e38757739e0697e6f0
2018-01-03 15:07:02 -08:00
Darío Hereñú b7f783d3c7 Fixing Typo in upgrade-v1 docs
Fixing a typo in docs/tutorials/upgrade-v1.md
2018-01-02 09:24:27 -08:00
Joey Parrish 9a69e26a86 Fix upgrade guide links
Change-Id: Ia5427a5b50850e820b04dbf5ba66b2146820f3a1
2017-12-22 15:15:54 -08:00
Joey Parrish ab0db55d27 Update upgrade tutorials to target v2.3
Also adds:
 - Missing details on a deprecated config field in the v2.2 => v2.3
   upgrade guide & changelog
 - Missing details about new language/role APIs in the v2.2 => v2.3
   upgrade guide

Closes #1183

Change-Id: I57e8bf4e56ffb1d741b691cdeaeb22e435c26e41
2017-12-20 15:56:35 -08:00
Joey Parrish 918a122a57 Update service worker caching docs
Issue #1183

Change-Id: If6eb7add692e31efa99008773f4107ea45cc3013
2017-12-20 03:02:52 +00:00
Joey Parrish e23bfb3a24 Update manifest parser tutorial
Issue #1183

Change-Id: Ic16e84f98cb45f2ecbba6da985f310e8f55b6b42
2017-12-20 03:02:52 +00:00
Joey Parrish 3f65d1c8a7 Update plugin tutorial
Issue #1183

Change-Id: If7024cbfabb7d85299162cb6488b5f44ed07febd
2017-12-20 03:02:52 +00:00
Joey Parrish 62e77876fa Update offline storage tutorial.
Issue #1183

Change-Id: I0ac267b2c620b9d28c3cf4a28c103e8ef772c368
2017-12-20 03:02:52 +00:00
Joey Parrish a17e904261 Add upgrade guide for v2.2 => v2.3
Issue #1183

Change-Id: Ib933603dd5ea35e1aa2c600970ce71a9a0a37b2e
2017-12-20 03:02:52 +00:00
Joey Parrish cd04cca269 Update config tutorial examples
Issue #1183

Change-Id: If3f9eb587c87babe7a8b43b5ced7d1b80205b1c1
2017-12-18 22:14:42 +00:00
Joey Parrish 4372d482b2 Update FAQ
Issue #1183

Change-Id: I1830b1343b11567643ef1994113265c037662701
2017-12-16 10:41:44 -08:00
Joey Parrish 08601defc8 Refactor README.md and welcome.md
README.md duplicated some information from welcome.md, included other
details better left to welcome.md, and did not provide clear enough
information about support and features.

This moves some parts of README.md to welcome.md, drops others, adds
some details about feature set, and reformats some of the existing
support information into tables.

Change-Id: Ic863bc47fd46d01ca57d126654b2c9902a4b17bb
2017-11-28 00:14:32 +00:00
Joe Medley 1cf25d433a Correct name of init function. (#1124) 2017-11-14 11:58:49 -08:00
Joey Parrish 5f81a464bd Update address of Widevine proxy to UAT
The appspot proxy address has been deprecated. UAT is now preferred.

Change-Id: I7a5f5eac554ec70eec83218d79f4927becd23828
2017-10-31 09:12:05 -07:00
Joey Parrish 9e571b3938 Update docs with regard to users list
The users list is now for announcements only.

Issue #1095

Change-Id: I4d86bfda5c116e88b950e2139a1c3d42afc91693
2017-10-30 15:28:16 -07:00
Aaron Vaage d85abe86da Offline Tutorial
This change include the offline tutorial to show users how to set up
storage and use offline playback.

Change-Id: I470bfc6761a433116a766d338ac2a87eee1bde28
2017-10-18 18:45:19 +00:00
Joey Parrish 37753aaa9a Update docs with regard to text namespace
We moved TextEngine to a new namespace between v2.1 and v2.2, but
forgot to update the relevant docs.

Closes #1046

Change-Id: Ifddbe03931b2e76cc4778aaa4c3c70695a2dce62
2017-10-03 20:48:41 +00:00
Jacob Trimble c9aca1aeb9 Add CORS explanations to tutorial.
Closes #1018

Change-Id: I0ec915fe37b3cc62aff0184f2306297b388db701
2017-09-26 17:17:23 +00:00
Joey Parrish c7cd714b0d Fix FAQ typo
Change-Id: I6f2cd0b383ab849e7b4b0d14929b7c4b16dfa8e4
2017-08-31 20:05:37 +00:00
Joey Parrish 16f3965496 Update FAQ with regard to error codes
We no longer use UNPLAYABLE_PERIOD when TS is unsupported.

Change-Id: Ic6278e8eda62d8fd55697c64226a4ac868078a1e
2017-08-14 15:04:30 -07:00
Joey Parrish 7d42496a59 Fix upgrade guide titles and links
Change-Id: Ie6f5abde281ae7f2f1c6552f749a82d91694c736
2017-08-11 16:04:33 -07:00
Joey Parrish 2af0de2adb Move streaming retry logic into callback
Closes #960

Change-Id: Ieeacbf2e25f53a5af25a1de1935085e43457a092
2017-08-10 20:27:53 +00:00
Joey Parrish 53c3ad776c Fix order of operations in ABR upgrade docs
ABR should be disabled before selecting a new track.  The demo app
does it right, but the upgrade docs had it in the wrong order.

Closes #962

Change-Id: I57020098f24401c7d56acfe050cf2363cd22621f
2017-08-10 18:32:24 +00:00
Joey Parrish 37ebcffbfe Add player.retryStreaming()
This method will allow applications to retry streaming after a
failure.

Issue #960

Change-Id: I2c97f6dea44dbc9431182172101f99d740ea177f
2017-08-10 10:54:34 -07:00
Joey Parrish 7e0f46931e Overhaul variant-based and stream-based interfaces
While I set out to fix failing assertions during playback, I found
many more changes necessary to clean up the code and make things more
consistent.

When we changed switch history to include variants instead of streams,
we broke the filtering logic that is applied to the history.  This
caused assertions at runtime that were not caught by the tests.

This moves the filtering logic to addToSwitchHistory_ and makes it
aware of variants.  It also adds a regression test that would have
caught the assertions.

This fix affected many other tests, though, which necessitated other
API changes and cleanup.

Many interfaces are simplified, as is switching logic in Player.  The
data flow is also easier to follow, since there are fewer transitions
between variant and stream.  Everything up to StreamingEngine uses
Variants, and StreamingEngine uses Streams internally.

  - All stream-based interfaces on AbrManager replaced
    - switch callback takes a variant
    - chooseStreams replaced with chooseVariant
    - setTextStreams has been dropped
    - Player maintains compatibility with old interfaces until v2.3

  - Most stream-based interfaces on StreamingEngine replaced
    - onChooseStreams callback to Player returns variant & text
      instead of a stream map
    - switch was replaced with switchVariant and switchTextStream,
      both of which delegate to switchInternal_, which is largely
      unchanged from the original switch method
    - still has getActiveStreams, which I hope some day can become
      getActiveVariant and getActiveTextStream so Player no longer
      has to convert anything

  - Most stream-based logic in Player replaced
    - deferred switches map broken into variant and text members
    - switch history logging broken into simpler variant and text
      methods
    - simplified manual and automatic track selection logic using
      new AbrManager and StreamingEngine APIs
    - player no longer filters duplicate selections, StreamingEngine
      handles that
    - replaced one case of deferred switches with an assertion

Closes #954

Change-Id: Ia49f6ffb9c5fa13ed8790dd03eeeded5122f7683
2017-08-03 21:34:47 +00:00
Joey Parrish 015b4f456f Revert timeline correction code.
This reverts commit 478fb1a473
("Detect and attempt to correct timeline sync issues") and commit
4334b6ea90 ("Add mediaSegmentReferences
 to shakaExtern.Stream").

Timeline correction only addresses one class of broken live content,
while actually making it more difficult to diagnose other classes of
broken live content.

Issue #933

Change-Id: Ie71b8a45600ed0994626f53268fb90e336c3c62b
2017-07-31 10:42:33 -07:00
Sandra Lokshina 978e49789e Update upgrade guides with v2.2 changes.
Closes #930.

Change-Id: Ie31f6f1e90df6dd4a768f7a662d68e31d6014bea
2017-07-25 20:23:52 +00:00
Joey Parrish 4334b6ea90 Add mediaSegmentReferences to shakaExtern.Stream.
This will allow us, in many cases, to detect time sync issues in
content by comparing the media segment references to the presentation
timeline.  If the references are outside the timeline, it may indicate
a common form of bad content, and we may be able to attempt to correct
it.

In some cases, the references are not available upfront.  We can't
detect time sync issues in DASH with SegmentTemplate+duration, because
the references are not explicitly described by the manifest.  We can't
detect time sync issues in DASH with SegmentBase, because the segment
index requires additional fetching and parsing.  (SegmentBase is not
used with live content, so this should be a non-issue.)

This only introduces the new data, but does not use it for detection
or correction yet.

Issue #933

Change-Id: If70b1bdbd3b08a7c8b7ae296da209737492dfe17
2017-07-25 20:13:42 +00:00
Joey Parrish 6ca00260ee Emphasize HTTPS requirement for EME in tutorials
- Move the note about EME and HTTP to the top of the DRM config
   tutorial
 - Reference this note in both the server authentication and license
   wrapping tutorials

Closes #928

Change-Id: Ibb47053c6ce5db1e1b120e0bb810c1f9f9069a82
2017-07-17 09:23:39 -07:00
Sandra Lokshina 5e8fc2065d Update HLS TS question in FAQ.
Update HLS TS question in FAQ to include info about our ongoing
effort on transmuxing TS to fMP4. This will let people know that
the solution is coming and subscribe to the issue on github.

Change-Id: I9b90e4c355834573a0d23472a2ffd369847ddb16
2017-06-22 21:08:33 +00:00