Commit Graph

17 Commits

Author SHA1 Message Date
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
Joey Parrish fd0449d8f7 Re-enable some disabled style rules
This re-enables the following style rules:
  - "block-spacing"
  - "brace-style"
  - "comma-dangle"
  - "comma-spacing"
  - "new-cap"
  - "no-multi-spaces"
  - "no-multiple-empty-lines"
  - "one-var"
  - "padded-blocks"
  - "prefer-rest-params"

Change-Id: I15d616e8d5b88b273ded6128b4f9ad86bdb26bd1
2018-07-09 19:44:56 +00:00
Jacob Trimble f70436540c Convert 'var' to 'let'/'const' (3 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: I10f5c38a8b06b5797c6eec7492829084114514c9
2018-02-14 00:47:03 +00:00
Jacob Trimble 575f2ad109 Add an indicator for critical errors.
This adds a severity field to Error objects.  This can be used to
detect whether an error is recoverable.  All the same errors are still
reported so the field can be ignored.

There are two possible values:
* RECOVERABLE means that the Player will try to recover from the error
* CRITICAL means the Player will be unable to continue and must call
  load() again

Closes #564

Change-Id: Ie2c5468340c13e7a288b99690ab65b7ecc0a6b29
2017-04-04 23:57:59 +00:00
Joey Parrish d97e9829b2 Add missing requires
Caught by an upcoming version of the Closure Compiler

Change-Id: I0f76146c04d7b9d0d433d5f7058c78d806f50384
2016-12-14 14:25:33 -08: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 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 a4b947c9a4 Add @struct to @constructors
Change-Id: I0c4f0468cc0f7632c71ec15e458c9a1d84a2c2af
2015-12-07 18:04:55 +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
Jacob Trimble fc0f19c469 Support WebM with unknown Segment size.
The init segment for WebM can specify a Segment element of an unknown
size.  This means that the segment should take up the remainder of
the data.

Change-Id: I77b503f1f034396f7ce1bb81d4b7c426a31f8b3f
2015-11-04 19:19:42 +00:00
Joey Parrish 4cc4e96dbd Overhaul license comments and file annotations
* Updates all Copyright years to 2015.
* Adds licenses annotations to all JS.
* Makes all licenses identical to avoid repeated appearance in the
  compiled output.
* Drops fileoverview annotations, which do not affect docs output.
* The linter still requires fileoverview on externs.

This patch required a newer closure compiler, since the previous
version we used had a bug regarding license annotations that caused
the license comment block to appear in the output once per file
regardless of uniqueness.

Change-Id: I2e9272db680cba7ecc4613d97f1d3a94ac2244cc
2015-09-08 12:02:34 -07:00
Joey Parrish 4d9177240a Revert "Adding license annotation to js files."
This reverts commit 8cb24652cb, due to
the fact that the new annotations caused our binary size to jump
by 52%.

The compiler preserves all 'unique' licenses, which causes trouble
since the comment blocks with the license annotations are not unique
and contain file overview comments as well.

We can re-examine this once we have restructured the license headers.

Change-Id: I418e407a0e0253630633697f30cf496a7fc2ddfc
2015-09-04 18:36:39 -07:00
Yohann Connell 8cb24652cb Adding license annotation to js files.
Change-Id: Id10592ccaf35608ac4f01844cae2fec4a2030d65
2015-09-04 00:05:17 +00:00
Joey Parrish 1e400f536f Avoid load-time uses of Uint8Array.
This is inteded to fix a couple of the load-time exceptions seen
when loading the library on IE9.  Eliminating load-time exceptions
will make it possible to use isBrowserSupported() as intended, to
avoid use of the library on older browsers.

Issue #87

Change-Id: I993d4f955e80a7401bea182ae90df43a8a022ca2
2015-06-02 16:31:27 -07:00
Joey Parrish f7d9ea5794 Refactor StringUtils into Uint8ArrayUtils.
Most of these StringUtils were either operating on Uint8Arrays directly
or using strings to move around Uint8Array data anyhow.

Change-Id: I71efe6ede34210ca721d46acd53452344efff5bb
2015-01-29 09:41:06 -08:00
Joey Parrish b3d035be9f Shaka Player release v1.0 2014-12-19 14:26:19 -08:00