Commit Graph

82 Commits

Author SHA1 Message Date
Joey Parrish d66d6c4255 Upgrade mux.js and use minified version
The new mux.js release fixes support for a minified build, so we
should use that from now on.

videojs/mux.js#173

Change-Id: I08cff8d33a520fe753c5490a4719cba3bb27f19e
2019-05-13 14:24:41 -07:00
Joey Parrish fd94c685ee Use clean-css plugin in less.js to minify CSS
Saves 30kB on the UI controls CSS and 8.5kB on the demo app CSS.

Change-Id: Ia17a8096bf014f257eefc3ded918ff2452436154
2019-05-13 17:43:40 +00:00
Joey Parrish 23c79955a7 Fix inlining of external CSS
Importing in less is not enough.  It will not necessarily inline what
is imported by default.  The "inline" option, however, will force the
CSS file to be inlined.  Without this, some of the `@import`
statements are put directly into the output file, triggering
additional network requests at runtime.  This also adds the "css"
option, which forces less to treat these inputs as CSS and not as
LESS.

Finally, we import MDL for the demo app as a node dependency instead
of loading it from another origin.

This improves the demo's Lighthouse scores of "First Contentful Paint"
by 27% and "First Meaningful Paint" by 14%.

Change-Id: I28e627d3df494e3c4893d31b6bf818f09e8153e9
2019-05-13 17:43:40 +00:00
Jacob Trimble a90a8f9fe4 Upgrade eslint.
This allows us access to more lint rules and will eventually allow us
to enforce the "indent" rule for the Google style guide.

Change-Id: I993ab1280c3781cb4b56179b3b1389879501516f
2019-05-08 10:20:00 -07:00
Joey Parrish 3ef441c602 Update changelog for v2.5.0
Change-Id: I515572a11da07c3b153f2e55941606eb799c86fa
2019-05-07 22:32:52 +00:00
Theodore Abshire efc2ed3df1 Added new demo page.
This is a complete replacement for the old demo page, made to be more
modern-looking and easier to maintain. It contains new features such as
remembering the URIs you provide for custom assets, and searching through
the default assets by feature.
This demo page is not quite ready for release yet, but it's getting close.

Change-Id: Iad01d1fc02c3cd238d73b9b9e02dbb4301cb6f2a
2019-05-01 19:58:18 +00:00
Joey Parrish 79077b89b3 Update changelog and bump versions for v2.5.0-beta3
Change-Id: I12292c9dadfb4d179adeadb12c45cf7e7a05e296
2019-02-20 09:46:36 -08:00
Joey Parrish da5c399863 Upgrade mux.js to the latest
Related to b/70902665

Change-Id: I1b58365b4cb484c712e57c56b9f998b51df4936a
2019-02-12 23:16:56 +00:00
Sandra Lokshina 6b1ca2d229 Initial release of Shaka Player UI
Other contributors:
 - @joeyparrish
 - @michellezhuogg
 - @TheModMaker
 - @theodab
 - @vaage

Change-Id: If6df33d9ab5035d1ead4402004f7de37ee8470f4
2018-11-16 14:40:37 -08:00
Joey Parrish 6b976c07ac Update changelog for v2.5.0-beta2 and bump versions
Change-Id: Ic6709aefa478d1675f539c05cd104131a226adbe
2018-11-09 21:25:30 +00:00
Jacob Trimble cdf2348077 Work around bug in wd module.
Version 1.11.0 of the wd module has a bug that breaks our remote
browser tests.  It has been fixed in their master branch, but we are
waiting for them to make another release.

https://github.com/admc/wd/commit/b9678b7602b738ac2906aa4dbd2bac60f861d878

Fixes: 117771894
Change-Id: Iba346590989990ec0885c4d72ce41afac7d8b8d9
2018-10-17 13:23:39 -07:00
Joey Parrish 9211dc129c Add changelog and bump versions for v2.5.0-beta
Change-Id: I6ebfe140d82bb7eb9100211c90023c9b2f352f55
2018-08-23 21:54:42 +00:00
Michelle Zhuo 1a8c63eb35 Upgrade mux.js
Upgrade mux.js to verison 4.5.1 since it supports CEA608/708 closed
captions parsing for Dash now.

Issue: #1404.
Change-Id: I09c26dc44ba2e68734f201f58ba8856c836ed55e
2018-08-17 11:21:48 -07:00
Joey Parrish f164934ce2 Unfork "wd" module
My changes have now been accepted upstream.

Change-Id: I4abfbad9ddcf1167c9b9a7eacfb509ce4552474a
2018-06-01 16:51:41 +00:00
Joey Parrish d70196ba7e Upgrade WebDriver module to new W3C protocol
The WebDriver protocol has been updated, but the "wd" module in node
only speaks the old protocol.  Firefox and IE have updated their
drivers to speak the new protocol, which means that the "wd" module
can no longer speak to Firefox and IE.  This overrides the "wd"
dependency from "karma-webdriver-launcher" with a forked version of
"wd" that speaks enough of the new protocol for Karma to do its job.

Fixes: 80138962
Fixes: 80140386

Upstream issue: admc/wd#495
PR: admc/wd#533
Related: SeleniumHQ/selenium#5952

Change-Id: I6e255543b36c908e59565268fa13abb01f9c9e12
2018-05-29 22:58:08 +00:00
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
Joey Parrish 0b75b8c974 Bump version numbers for v2.4
Change-Id: I55d42050ba0f6c648049546f8135cf64980f1c0d
2018-04-11 08:04:45 -07:00
Joey Parrish 8bce0b34e6 Build docs before publishing on npm
Change-Id: Id79f8a68cbfbb2462fca24210447bb7fee83a68e
2018-03-29 10:31:48 -07:00
Joey Parrish b27ea82e7f Allow Player to attach/detach from video
This adds attach/detach methods to replace the media element in the
Player constructor.  Now applications can take back control of the
media element or provide a reference later in the Player's life cycle.

This also allows applications to decide whether or not to set up
MediaSource in advance, through an optional argument on attach and
unload.  The default will be to set up MediaSource in advance, which
maintains current behavior.  This advanced setup of MediaSource can
improve load latency later.

This change also introduces async/await for the first time in the
project, which required changes to eslint config, Closure build
arguments, Babel & Babel-polyfill setup, and the esprima parser used
by our extern generator.

The use of async/await will improve readability in many places, and
these infrastructure changes to enable async/await should also unblock
issues #1336 and #1337.

Closes #1087

Change-Id: I0d6b4e0e2af27a6520a3d070fa92b7139b2cb8b0
2018-03-06 22:19:53 +00:00
Joey Parrish 1f1c05fbc1 Upgrade promise-mock
The new release has a new parameter in runAll() which simplifies
flush().

At this point, we could technically do away with our flush() method
and call runAll(false) directly, but I find flush() more clearly
indicates to the reader what we are doing.

Change-Id: I90f105ff38d032e3c9caf5484d78824dc64fe43d
2018-03-01 18:41:52 +00:00
Joey Parrish 5061631f29 Sort jsdoc tutorials according to the config file
This feature is based on a forked version of jsdoc which we hope to
land https://github.com/jsdoc3/jsdoc/pull/1502 upstream.

Closes #1259

Change-Id: I48e07ffd8ae9fc2c07cd48b3e02b85e87694d341
2018-02-02 14:51:40 -08:00
Joey Parrish ed54199260 Upgrade and unfork jsdoc
This updates jsdoc to the latest version from npm and forks a copy of
the default jsdoc template.

In subsequent commits, we will reapply our customizations to the
template and to a jsdoc plugin.

This also fixes several bad annotations that the new jsdoc failed to
parse.

Issue #1259

Change-Id: I00a47270ea4754e1c96c43ca900d5cf889ab72e6
2018-01-31 22:04:48 +00: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
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
Joey Parrish 4067c20a7c [ES6] Replace gjslint with compiler linter & eslint
The eslint configuration is derived from analyzing the style of our
sources as they are now, plus a few tweaks.

In particular, we have disabled checks for undefined variables and use
of console, both of which the compiler handle with greater precision.
The compiler already knows what is defined in the environment through
our externs, and has specific exceptions for the use of console (demo,
tests).

We have also disabled a few checks that we should use, but will
require many changes to the code: no-unused-vars, no-redeclare,
and comma-dangle.

This commit also fixes several types of eslint errors that were easy:
  - no-useless-escape (unneccessary escape characters in Regexp)
  - no-constant-condition (using true/false/0/1/etc in if/while)
  - no-fallthrough (caught an actual bug in one EME polyfill)
  - no-irregular-whitespace (we had a UTF-8 nbsp in externs)
  - no-cond-assign (using an assignment inside a conditional)

To satisfy stricter provide/require checks in the Closure Compiler
Linter, we will no longer use provide/require at all in tests.  We
will still use provide in test utilities (test/test/util/) since it
sets up the namespace for us.  But we will not use require there
because there is no deps management for test code.

Issue #1157

Change-Id: Icc44f51feeb568ea7d3980e693e92e560d897afd
2018-01-16 17:25:05 +00:00
Joey Parrish 374653abba [ES6] Use babel to preprocess tests
Once we start moving to ES6, uncompiled mode stops working on non-ES6
browsers (IE11 is the only one we test on).  We can disable uncompiled
mode in the demo, but we still want our tests to be uncompiled.  With
uncompiled library & tests, we can test units that are not exported
and even access private members that would otherwise be renamed.

For production/demo, Babel plays no role.  The Closure Compiler will
take in ES6 and spit out ES3 syntax (even older than ES5, so we can
at least run & fail a support check).

Babel will be used by Karma to preprocess all test and library code
before serving it from Karma.  This will allow us to use ES6 in both
the library and the tests, and still run uncompiled tests and test the
uncompiled library on ES5 browsers such as IE 11.

Issue #1157

Change-Id: Idd185d0e231d16b6df52babda777111e85890012
2018-01-05 20:10:42 +00:00
Joey Parrish b763bf43d9 Bump version numbers for v2.3
Change-Id: I0e2e1540871223e71c56e10cf6b940f391943e57
2017-12-20 16:29:53 -08:00
Michelle Zhuo e516a64487 Transmux from Transport Stream to MP4
Supporting Transport Stream by transmuxing it to MP4, with mux.js
library.

Issue #887

Change-Id: I70361bb364721fc5e72cba7d0fabc311ce0ba8b5
2017-10-20 18:14:02 +00:00
Jacob Trimble 56740adffb Have all.py build both debug and release builds.
Change-Id: I67e830d45f7d4383b313c835c55b3119349ab1d2
2017-10-19 20:22:07 +00:00
Joey Parrish 43f9b56836 Update jasmine-core
This updates our jasmine-core dependency to the latest version.
In v2.8, some of the output from test failures is much more legible
than in v2.6.

Change-Id: I56ac0aa47fdd18ac57108c1e481ef9269269da51
2017-08-28 23:32:10 +00:00
Joey Parrish 6a7370b106 Update changelog and versions for v2.2.0
Change-Id: I9b022dd185c2c431dbf6dbf3cd9b9fabd4ce6356
2017-08-22 21:40:46 +00:00
Joey Parrish fdfa27083d Update which module to simplify browser list
Now that npm/node-which#51 is closed and the fix has been released in
which v1.3.0, we can simplify away the try/catch when we check for
available browsers.

Change-Id: If849299f75e5e4927756a1692ebe017dd5d80f34
2017-08-01 10:52:43 -07:00
Joey Parrish 6b46d49d2a Add "build/test.py --browsers help" to list all
Now we can snoop in the karma config and find a list of all usable
browser launchers.  This allows us to provide hints for what browsers
could be used.

Change-Id: I7116eb72957c7f8b924380c26c4c66cdca50c0bc
2017-07-31 19:19:15 +00:00
Joey Parrish 96efea1c37 Force a rebuild during publication
This fixes an issue in which we released several builds (v2.1.3,
v2.0.4, and v2.0.3) with the wrong version number.  This happens when
we build, then tag, then release.

By forcing a rebuild at publication time, we make sure the build we
release has the right tag in it.

Issue #869

Change-Id: I23867ceef43162469c53006336b7f0226dbe16b6
2017-06-12 15:58:05 -07:00
Joey Parrish fae6463513 Update all node modules
Change-Id: I85be9d4e4224d9e9a3b3f69a5b63af359b9534b5
2017-05-10 16:38:19 +00:00
Joey Parrish a51a1b3584 Upgrade jasmine-core
This upgrades jasmine-core to a version with jasmine/jasmine#1138
fixed.

Change-Id: I5021ad8d3a6942afc85370ce0ff15bd07fd0945e
2017-05-10 16:37:50 +00:00
Joey Parrish fd8453a016 Fix test failures caused by jasmine-core v2.6.0
In jasmine-core v2.6.0, our DASH tests fail with "first.getUris is not
a function".  The cause is unclear, but rolling back to jasmine-core
v2.5.x fixes the failures.

Change-Id: I5a2d8384d601677da9e8e16f6cfcab668c8b5117
2017-04-24 15:44:43 -07:00
Joey Parrish e37cba8e35 Update changelog and bump versions for v2.1.0
Change-Id: I192e17601ec0c798ffa76020584666bd3043897c
2017-04-20 21:42:24 +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 55b8ef4b65 Add Edge launcher to npm modules.
Change-Id: I8902d81cbc833284efb04b4336734389b579a9e5
2017-03-17 12:07:45 -07:00
Joey Parrish 8ba088a38f Generate externs automatically
We were not able to get our externs generated by the Closure compiler.
There were many issues with the Closure-generated externs, including
the order of the externs and the replacement of record types and enums
with their underlying types.

We made a few attempts to patch the compiler, but could not get our
patches accepted upstream.

This change introduces a new script to generate our externs from
scratch.  It uses a JavaScript parser called 'esprima'.

Some interfaces need to be exported to the generated externs, but are
not actually attached to the namespace by the compiler.  For this, we
introduce a new annotation.  These are the currently-supported export
annotations:

 - @export: truly exported (attached to namespace) by the compiler
 - @expose: truly exposed (not renamed) by the compiler
 - @exportDoc: considered part of the exports in the docs
 - @exportInterface: considered part of the exports in generated externs

These annotations are now documented in docs/design/export.md

Change-Id: I33bf7384889c14c9edb0fa5f11caa7c4f4d79af6
2017-02-01 11:42:16 -08:00
Joey Parrish ce72a46b84 Update useragent module to an official release
3rd-Eden/useragent#99 was merged and the changes were released in
version 2.1.11.  We can now detect Chromecast devices in Karma.

Change-Id: I3d326d9ef82eb878d3a42c1d442543bb503b2ce7
2017-01-19 09:33:12 -08:00
Joey Parrish f25e947c5d Use forked useragent module for Chromecast detection
This is temporary until 3rd-Eden/useragent#99 is merged and released.

Change-Id: I94e2c3aac7c9a6bed4c3947f36468bb1a6e35ee0
2017-01-18 23:32:32 +00:00
Joey Parrish 6f65df26c5 Whitelist svg camelcase attributes in htmlhint
This is better than ignoring all camelcase.

Introduced by yaniswang/HTMLHint#121 and released in 0.9.13.

However, 0.9.13 is incompatible with node v0.10.  This was fixed
in yaniswang/HTMLHint#132, but there has not been a release since
(in 8 months).

Therefore we are pinning to today's git version instead of a release.
This gets us the camelcase whitelisting feature and doesn't break with
node v0.10.

Change-Id: I1e3b6c0c96ef24662b46497b1a601bde0dae5704
2017-01-18 13:59:54 -08:00
Joey Parrish d22900692e Upgrade jasmine-ajax and enable redirect test
Change-Id: I514090f160099ad4afc3446100a4753f714fbbff
2017-01-18 21:34:02 +00:00
Jacob Trimble 40aab9387e Allow compiling a debug compiled file.
This adds a new option (--debug) to build/build.py which allows
building for debugging.  This will expose all internal members on the
global |shaka| object and will not rename anything.  This allows apps
to import the single compiled file but still perform debugging.

This also changes the file naming a little.  Before, we would create
a |.debug.js| and |.debug.map| file when we compiled.  However this
was not a debug file, it just linked to the source map.  Now it will
always generate the source map and attach it to the compiled file.  If
compiling with --debug it will add |.debug| to the file name.

This should also help with importing the debug library in ES6.
Issue #466

Change-Id: Ic51abbdb04763e8a3687c5d59a23d721436e1c7b
2016-12-20 00:43:44 +00:00
Joey Parrish 17d63566b4 Update changelog and versions for v2.0.0
Change-Id: If1881dc31e5f65e5918d459209e605570c95891a
2016-09-06 18:26:29 +00:00
Joey Parrish 617bc5b3b4 Upgrade Karma to v1
This improves some disconnection errors on Safari.

Change-Id: I679d7751b9371c03e71df12d9914ebf2b5a15ee1
2016-08-10 16:27:41 +00:00
Joey Parrish 3978a8626b Update changelog and versions for v2.0.0-beta3
Change-Id: I0eebb4d035c9432376659e19e388c37b2454b954
2016-07-29 18:42:37 +00:00
Joey Parrish d733c8eee2 Update changelog and versions for v2.0.0-beta2
Change-Id: I474c2ff1a1a14aa2b1f1569e59e1c27326d59a7f
2016-05-04 00:47:34 -07:00