Commit Graph

587 Commits

Author SHA1 Message Date
Joey Parrish 4ec3d3a67a Clean up node metadata
- Fix dev-dependency installation
- Fix npm license format warning
- Ignore node_modules

Now dev-deps can be installed simply by running "npm install".
Because of npm/npm#3059, this requires the in-publish module.

Change-Id: Idc2eeca5b172de50760a6fadacb1d1088985f840
2015-12-15 20:32:13 -08:00
Joey Parrish 6876ee08cc Use navigator instead of Navigator.prototype
This fixes support checks on Chrome 26, 27, and 28,
and Opera 15.

Change-Id: Ib33ca28754153679bda41fc3c2f6a37a93ed2c99
2015-12-15 17:37:29 +00:00
Joey Parrish bc7c8b88bd Fix build error for unused require
Change-Id: I9341965f7c9be20412d60556d00a0e52dd30c217
2015-12-14 14:44:15 -08:00
Timothy Drews 7a39dce09e Update SegmentIndex functions within the Manifest.
StreamingEngine will require lookup by position and not
just by time.

Change-Id: Ic0f46173f42aa5e4689687e54c7f5f89779ec855
2015-12-14 17:25:35 +00:00
Jacob Trimble 398bf66edd Silenced console logs for tests.
Now only error logs will be displayed, except when they are expected.
This also allows the logging in the tests to be changed easily in
one place (spec/util.js).

Change-Id: Ib7dd093ebfd2f7004392b775c7bce48dc43ec6fc
2015-12-11 23:23:44 +00:00
Joey Parrish 1d1a0fcb46 Enable all compiler errors
This also cleans up compiler errors for:
  - Things required but not used
  - Things used but not required
  - Write-only local variables

We are suppressing the 'unnecessaryCasts' error in specific places
where it is, in fact, necessary to convert between unrelated types
for polyfills and work-alikes.

Change-Id: I155c746116f95383ea0a9caf9239fadccd8601af
2015-12-11 13:30:44 -08:00
Joey Parrish b7fe065419 Add minBufferTime to manifest
This is needed by both the DASH parser and the StreamingEngine.

Change-Id: I7458cbc9f9ee7c4d646e1c491f3966c0012d7bf3
2015-12-10 14:28:44 -08:00
Joey Parrish c9235f859c Add support-testing framework.
Support testing is hierarchical.  Player.support returns an object
mapping out the support present in various parts of the system.

This creates a shell for Player and DrmEngine, and introduces support
tests for MediaSourceEngine, ManifestParser, and DrmEngine.

This also adjusts the way support checks are done for text types, to
allow for expansion into MP4-embedded text types and other segmented
subtitle types.

Text changes related to #150 and #146

Change-Id: I707f01ba52cba6262ee89bee2c1f28d24aca4655
2015-12-10 20:00:22 +00:00
Joey Parrish 3e7014db2b Fix library load and polyfill for old browsers
This will allow support-testing to work on older browsers so that
application developers can still load the library and query for
support to show an appropriate error message.

To accomplish this, we avoid load-time uses of Function.bind, avoid
certain polyfills if modern types are not available, and compile down
to ES3 to avoid errors caused by use of the reserved word "catch" on
Promises.

This has been tested back to IE6, Safari 5.1, iOS 6.0, Firefox 6,
Chrome 15, and Opera 16.

Change-Id: I9deed106a7736758e04452ef85bae40f37c6fe62
2015-12-10 10:49:45 -08:00
Jacob Trimble 5616a47c72 Added Manifest Parser interface.
b/25851171

Change-Id: Ib3f0df9107f81bcf1fa266a980bdf9b5c716210a
2015-12-07 18:11:45 +00:00
Joey Parrish a4b947c9a4 Add @struct to @constructors
Change-Id: I0c4f0468cc0f7632c71ec15e458c9a1d84a2c2af
2015-12-07 18:04:55 +00:00
Joey Parrish a06179bc9e Update redesign doc
Change-Id: I653fce976171043fccefc190ab8a008e2e153c4f
2015-12-07 18:04:38 +00:00
Joey Parrish 316e4c291f Fix compiled Promise polyfill
Installation of the Promise polyfill was incomplete in compiled mode,
since static methods were not attached to the constructor by the
compiler.

Cherry-picked from v1.6.1.

Change-Id: I304662dfdb88d2fb76fc8c06a23fc6fae2f5b1f1
2015-12-06 22:45:56 +00:00
Joey Parrish c934f426d8 Add new error type
This error type will be used for all internal errors, and will rely
on numeric error codes which can be easily checked by the application.

This also changes PSSH parsing to throw on errors instead of retaining
partial data.

Issue #201
b/25306826

Change-Id: I19d23d99d4ee72cb31fe5f233bac57a3a9cfc283
2015-12-04 10:26:08 -08:00
Joey Parrish 9dbd6e6549 Add messages to all assertions
This makes debugging easier when an assertion fails.

Change-Id: I362e58706c71a12cffcda84dcd0b9ad281c51f30
2015-12-04 02:17:28 +00:00
Joey Parrish 4ee5f77772 Quiet down warnings from MPD util tests
Change-Id: I04901090ed4c70d08e9a08f6b108f92485584a05
2015-12-03 17:10:29 -08:00
Jacob Trimble 7e20a8ea68 Updated WebM and MP4 segment index parsers.
* No longer uses FailoverUri.
* Uses string URIs directly.
* WebM now gets the last segment's duration.

Change-Id: I1b17f95c4f3fed4bf7e46964687670860240cc2b
2015-12-04 01:08:04 +00:00
Joey Parrish 1a3786b5d7 Add "kind" property for text streams
Issue #206

Change-Id: Id731da4b2d76a8fd62e316317600cae094c5255c
2015-12-03 16:32:56 -08:00
Jacob Trimble 9701e184e5 Imported WebM and MP4 index parsers from master branch.
These will not work as-is because FailoverUri is removed.  I will
update them in another change.

Change-Id: If8951f6499c13f83f33d5c7a14d86038793a11e1
2015-12-03 14:29:27 -08:00
Joey Parrish 0295dadba7 Update CONTRIBUTING docs
Change-Id: Iad1bfe89edc11882952e4d8e205a08d05a9d9a2d
2015-12-02 12:42:18 -08:00
Joey Parrish fff5dd7ee7 Audit exports
This changes namespace exports to the more targetted exportDoc,
adds exports where they are needed and removes them where they are
not.  Exporting of Uint8Array and String utils should be re-evaluated
later.

Change-Id: I9298e73a0a5ef026b6f2b1854488d2c359be10c1
2015-12-01 13:56:37 -08:00
Joey Parrish cf53eda1f5 MediaSourceEngine integration tests
Change-Id: I9dea53285a18def6b6284ec9262e46b2d2b48b73
2015-12-01 21:52:51 +00:00
Timothy Drews f741ad6e3f Add MpdUtils.
Change-Id: Idbbeb7ed2d0534f148873e0a98dce0c0a4ac955f
2015-12-01 21:36:33 +00:00
Jacob Trimble 4a2ae58746 Imported LanguageUtils from master branch.
Change-Id: Ib4735529008c9c933102e48fd632fc205d7bf9e6
2015-12-01 01:04:11 +00:00
Timothy Drews 3b8563ee65 Add Manifest class and its dependences.
Change-Id: I65be31c74659ececa5d7b584c907642ee0466cc3
2015-11-30 17:01:23 -08:00
Joey Parrish db45f2c9fb Add comments to MediaSourceEngine's popFromQueue_
This is meant to resolve confusion about what popFromQueue_ does.
https://github.com/google/shaka-player/commit/a79cde2f#commitcomment-14687716

Change-Id: I21c99d2186913e464ed02000568bd4c2bd106e8e
2015-11-30 09:34:06 -08:00
Joey Parrish 184a2f2b35 Skip coverage stats for polyfills
Change-Id: I45abd1e80633f384e88d168a561ba82b0eb8729a
2015-11-25 15:00:31 -08:00
Joey Parrish 05fb5a3a25 Avoid testing Opera on Linux
Until I can figure out how to get Opera running on Linux with MP4
support, remove Opera from the list of Linux browsers to test.

Change-Id: I229c89bb0959a274cb7962338a448bca2a34ad14
2015-11-25 22:50:43 +00:00
Joey Parrish 54999fb6f6 Add assertion messages to StreamGenerator
Change-Id: I2af2eb8e4e0a6b92aca1611ba1b8b4af78c90eeb
2015-11-25 14:37:46 -08:00
Joey Parrish c3bcc0cf10 Always log assertions to the console in tests
Change-Id: I39d05fb91270557fa34f5c8143c30d2f6bfa3c00
2015-11-25 22:37:24 +00:00
Joey Parrish 817ea3d5ab Avoid karma v0.13.15
Avoid karma v0.13.15, which has a bug that prevents our new
integration tests from running correctly on Chrome.
(See karma-runner/karma#1101)

Change-Id: Ia81410b1184ddca3a703d71cd923d4ec0ae5eefc
2015-11-25 22:36:58 +00:00
Joey Parrish e83b72b407 Fix StreamGenerator WRT TypedBind
Change-Id: I632e90dbeb9598e671ba15dc84e311ef3ad9c9f0
2015-11-25 22:36:51 +00:00
Joey Parrish eaae43e58a Run Firefox tests with MSE and MP4 enabled
Change-Id: I546d65046eff9b3858f05eb283b3c80e12c6a273
2015-11-25 22:36:22 +00:00
Joey Parrish d78c9da52b Use shaka.log in StreamGenerator
This will allow us to better control log spam output by karma

Change-Id: I70af6878884708fdfffb780b3f0d5a1dd788db30
2015-11-25 13:50:44 -08:00
Joey Parrish 4ba815760e Silence unimportant warnings during PSSH tests
Change-Id: If0fde68e61acf0e3d39015d031ade0fc3d9e0b12
2015-11-25 21:49:09 +00:00
Joey Parrish 30f06a2162 Update redesign TODO list
Change-Id: I594324eeea41c189d6bb02e0da545ef0a0053043
2015-11-25 13:28:25 -08:00
Jacob Trimble 72cd63fc2b Added WebVTT text parser.
b/25325209

Change-Id: I1f3f267a27d758d0cbe8a0ef91811d422d4f0193
2015-11-25 12:14:05 -08:00
Timothy Drews 52e241ddbc Add SegmentIndex and SegmentReference.
Change-Id: I433b5251b25715e0461282e9fe287980ead5900d
2015-11-25 12:14:05 -08:00
Joey Parrish 0db2d601ab Fix tests on IE11
For IE11, Promise and CustomEvent polyfills needed to be installed,
our use of the Event constructor in EventManager tests needed to be
fixed, and our DataViewReader tests needed to accept IE's version of
RangeError.

Change-Id: I39a4a1e00836f15cab430c040fdbf19a52762cdb
2015-11-25 12:14:05 -08:00
Joey Parrish 862bbcc7b3 Add a test-runner script
This should make it easier to run tests in Karma.

Change-Id: I3899d2f435892ca725469773b8701c0f507d8a2c
2015-11-25 12:14:05 -08:00
Joey Parrish e0783c1686 Fix flake in NetworkingEngine retry tests
This mocks the date and clock for retry tests to eliminate flake on
busy machines (such as our buildbot).

b/25727620

Change-Id: Ied0f1a3a4aa72ec9d8fbc5c4b36a3c91a489e668
2015-11-25 12:14:05 -08:00
Joey Parrish 00c7b08222 Add dev dependencies for automated testing
This makes it clear and explicit which node modules we need to run
tests.  Anyone installing Shaka Player via npm can get the deps
automatically.

Change-Id: I77456d3351775444a2bc669dd0129ce4afc0d1a6
2015-11-25 12:14:05 -08:00
Joey Parrish 021e535a7b Do not compute coverage over debug code
Code coverage stats for debug code does not matter and skews the
report.

Change-Id: Id639a548681c22e8b4760f6e8520e68bcad67356
2015-11-25 12:14:05 -08:00
Joey Parrish c68ef2f8f7 Fix NetworkingEngine.destroy() behavior
Previously, destroy() would reject as soon as any in-progress request
failed.  Now, destroy() waits for all requests to end regardless of
their ultimate state.

Also adds tests to cover destroy() behavior and drops unused test
util code from 1.x.  Line coverage for NetworkingEngine is now 100%.

Change-Id: I0e39e494d8f28c6dc595725a46094d10e3a58e93
2015-11-25 12:14:05 -08:00
Timothy Drews 8c44ddc317 Add StreamGenerator.
StreamGenerator enables tests to use simulated content.

Change-Id: I0ff57281f4791cfe740c10db0f3e09f359e40900
2015-11-25 12:14:05 -08:00
Jacob Trimble 24eaf05fbc Added network plugin for HTTP and data URIs.
b/25296248

Change-Id: Iaea524f00e2297e151dc2fe93243083ce8b9949d
2015-11-25 12:14:05 -08:00
Jacob Trimble 667aee63ae Added URI argument to NetworkingEngine plugin.
b/25296248

Change-Id: I66ecb7aed9baf53cbafda3be9550dd03908226ce
2015-11-25 12:14:05 -08:00
Jacob Trimble ab127e6a04 Added NetworkingEngine.
b/25296248

Change-Id: I5cb64d47dd47624715a691a12243696932f2d5dd
2015-11-25 12:14:05 -08:00
Joey Parrish a79cde2fca Add MediaSourceEngine
This wraps all MediaSource and SourceBuffer operations in Promises
and synchronizes them.

b/25306817

Change-Id: I73483ba73427d309c4e09cb82ab6404a59e7a726
2015-11-25 12:14:05 -08:00
Joey Parrish 80ed769533 Do not use PublicPromise for delay
Change-Id: I39fd35b25e8321bb60788864091d454c149cf082
2015-11-25 12:14:05 -08:00