shaka-player 3.3.7 → 3.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/CONTRIBUTORS +2 -0
- package/README.md +20 -6
- package/demo/index.html +0 -2
- package/dist/controls.css +1 -1
- package/dist/deps.js +2 -2
- package/dist/locales.js +30 -30
- package/dist/shaka-player.compiled.d.ts +11 -0
- package/dist/shaka-player.compiled.debug.d.ts +11 -0
- package/dist/shaka-player.compiled.debug.externs.js +48 -37
- package/dist/shaka-player.compiled.debug.js +31 -26
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +48 -37
- package/dist/shaka-player.compiled.js +761 -760
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.d.ts +11 -0
- package/dist/shaka-player.ui.debug.d.ts +11 -0
- package/dist/shaka-player.ui.debug.externs.js +48 -37
- package/dist/shaka-player.ui.debug.js +33 -28
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +48 -37
- package/dist/shaka-player.ui.js +876 -875
- package/dist/shaka-player.ui.map +4 -4
- package/docs/tutorials/welcome.md +6 -3
- package/lib/dash/dash_parser.js +5 -0
- package/lib/hls/hls_parser.js +6 -2
- package/lib/media/presentation_timeline.js +24 -1
- package/lib/player.js +1 -1
- package/lib/polyfill/media_capabilities.js +1 -0
- package/lib/polyfill/videoplaybackquality.js +3 -1
- package/lib/util/platform.js +41 -1
- package/lib/util/string_utils.js +56 -14
- package/maintained-branches.md +15 -0
- package/package.json +2 -4
- package/app-engine/README.md +0 -9
- package/app-engine/demo-version-index/README.md +0 -14
- package/app-engine/demo-version-index/app.yaml +0 -2
- package/app-engine/demo-version-index/main.py +0 -162
- package/app-engine/demo-version-index/requirements.txt +0 -6
- package/app-engine/demo-version-index/templates/index.html +0 -114
- package/app-engine/shaka-player-demo/README.md +0 -18
- package/app-engine/shaka-player-demo/app.yaml +0 -61
- package/app-engine/shaka-player-demo/main.py +0 -95
- package/app-engine/shaka-player-demo/posters/10yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/10yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/1yo.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/2yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/2yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/3yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/3yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/4yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/4yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/5yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/5yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/6yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/6yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/7yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/7yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/8yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/8yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/9yo.png +0 -0
- package/app-engine/shaka-player-demo/posters/9yo.xcf +0 -0
- package/app-engine/shaka-player-demo/posters/audioOnly.gif +0 -0
- package/app-engine/shaka-player-demo/posters/audioRickRoll.gif +0 -0
- package/app-engine/shaka-player-demo/posters/colorbars.gif +0 -0
- package/app-engine/shaka-player-demo/posters/fireworks.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/party-hat.png +0 -0
- package/app-engine/shaka-player-demo/posters/sources.txt +0 -46
- package/app-engine/shaka-player-demo/posters/standard.png +0 -0
- package/app-engine/shaka-player-demo/posters/trek.jpg +0 -0
- package/app-engine/shaka-player-demo/posters/valentines.png +0 -0
- package/app-engine/shaka-player-demo/posters/zombie.jpg +0 -0
- package/app-engine/shaka-player-demo/posters.py +0 -110
- package/app-engine/shaka-player-demo/requirements.txt +0 -5
- package/app-engine/shaka-player-demo/time.txt +0 -1
- package/build/README.md +0 -127
- package/build/__init__.py +0 -0
- package/build/all.py +0 -150
- package/build/apps.py +0 -186
- package/build/build.py +0 -392
- package/build/check.py +0 -354
- package/build/checkversion.py +0 -84
- package/build/compiler.py +0 -513
- package/build/conformance.textproto +0 -335
- package/build/docker/Dockerfile +0 -20
- package/build/docker/docker-compose.yml +0 -10
- package/build/docs.py +0 -54
- package/build/eslint-plugin-shaka-rules/arg-comment-spacing.js +0 -72
- package/build/eslint-plugin-shaka-rules/index.js +0 -24
- package/build/eslint-plugin-shaka-rules/package.json +0 -7
- package/build/eslint-plugin-shaka-rules/private.js +0 -109
- package/build/gendeps.py +0 -71
- package/build/generateExterns.js +0 -867
- package/build/generateLocalizations.py +0 -262
- package/build/generateTsDefs.py +0 -137
- package/build/install-linux-prereqs.sh +0 -136
- package/build/license-header +0 -5
- package/build/misspellings.txt +0 -38
- package/build/pixelsChanged.js +0 -35
- package/build/shaka-lab.yaml +0 -163
- package/build/shakaBuildHelpers.py +0 -356
- package/build/stats.py +0 -816
- package/build/subprocessWindowsPatch.py +0 -103
- package/build/test.py +0 -541
- package/build/types/ads +0 -8
- package/build/types/cast +0 -6
- package/build/types/cea +0 -13
- package/build/types/complete +0 -9
- package/build/types/core +0 -108
- package/build/types/dash +0 -8
- package/build/types/hls +0 -9
- package/build/types/manifests +0 -5
- package/build/types/networking +0 -6
- package/build/types/offline +0 -22
- package/build/types/polyfill +0 -21
- package/build/types/text +0 -11
- package/build/types/ui +0 -39
- package/build/updateScreenshots.py +0 -85
- package/build/wrapper.template.js +0 -52
package/build/all.py
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2016 Google LLC
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
"""Builds the dependencies, runs the checks, and compiles the library."""
|
|
18
|
-
|
|
19
|
-
import argparse
|
|
20
|
-
|
|
21
|
-
import apps
|
|
22
|
-
import build
|
|
23
|
-
import check
|
|
24
|
-
import compiler
|
|
25
|
-
import docs
|
|
26
|
-
import gendeps
|
|
27
|
-
import generateLocalizations
|
|
28
|
-
import shakaBuildHelpers
|
|
29
|
-
|
|
30
|
-
import os
|
|
31
|
-
import re
|
|
32
|
-
|
|
33
|
-
def compile_less(path_name, main_file_name, parsed_args):
|
|
34
|
-
match = re.compile(r'.*\.less$')
|
|
35
|
-
base = shakaBuildHelpers.get_source_base()
|
|
36
|
-
main_less_src = os.path.join(base, path_name, main_file_name + '.less')
|
|
37
|
-
all_less_srcs = shakaBuildHelpers.get_all_files(
|
|
38
|
-
os.path.join(base, path_name), match)
|
|
39
|
-
output = os.path.join(base, 'dist', main_file_name + '.css')
|
|
40
|
-
|
|
41
|
-
less = compiler.Less(main_less_src, all_less_srcs, output)
|
|
42
|
-
return less.compile(parsed_args.force)
|
|
43
|
-
|
|
44
|
-
def main(args):
|
|
45
|
-
parser = argparse.ArgumentParser(
|
|
46
|
-
description='User facing build script for building the Shaka'
|
|
47
|
-
' Player Project.')
|
|
48
|
-
|
|
49
|
-
parser.add_argument(
|
|
50
|
-
'--locales',
|
|
51
|
-
type=str,
|
|
52
|
-
nargs='+',
|
|
53
|
-
default=generateLocalizations.DEFAULT_LOCALES,
|
|
54
|
-
help='The list of locales to compile in (default %(default)r)')
|
|
55
|
-
|
|
56
|
-
parser.add_argument(
|
|
57
|
-
'--fix',
|
|
58
|
-
help='Automatically fix style violations.',
|
|
59
|
-
action='store_true')
|
|
60
|
-
|
|
61
|
-
parser.add_argument(
|
|
62
|
-
'--force',
|
|
63
|
-
'-f',
|
|
64
|
-
help='Force building the library even if no files have changed.',
|
|
65
|
-
action='store_true')
|
|
66
|
-
|
|
67
|
-
parser.add_argument(
|
|
68
|
-
'--debug',
|
|
69
|
-
help='Limit which build types to build. Will at least build the debug '
|
|
70
|
-
'version.',
|
|
71
|
-
action='store_true')
|
|
72
|
-
|
|
73
|
-
parser.add_argument(
|
|
74
|
-
'--release',
|
|
75
|
-
help='Limit which build types to build. Will at least build the '
|
|
76
|
-
'release version.',
|
|
77
|
-
action='store_true')
|
|
78
|
-
|
|
79
|
-
parsed_args = parser.parse_args(args)
|
|
80
|
-
|
|
81
|
-
# Make the dist/ folder, ignore errors.
|
|
82
|
-
base = shakaBuildHelpers.get_source_base()
|
|
83
|
-
try:
|
|
84
|
-
os.mkdir(os.path.join(base, 'dist'))
|
|
85
|
-
except OSError:
|
|
86
|
-
pass
|
|
87
|
-
|
|
88
|
-
# Generate localizations before running gendeps, so the output is available
|
|
89
|
-
# to the deps system.
|
|
90
|
-
# TODO(#1858): It might be time to look at a third-party build system.
|
|
91
|
-
localizations = compiler.GenerateLocalizations(parsed_args.locales)
|
|
92
|
-
if not localizations.generate(parsed_args.force):
|
|
93
|
-
return 1
|
|
94
|
-
|
|
95
|
-
if gendeps.main([]) != 0:
|
|
96
|
-
return 1
|
|
97
|
-
|
|
98
|
-
check_args = []
|
|
99
|
-
if parsed_args.fix:
|
|
100
|
-
check_args += ['--fix']
|
|
101
|
-
if parsed_args.force:
|
|
102
|
-
check_args += ['--force']
|
|
103
|
-
if check.main(check_args) != 0:
|
|
104
|
-
return 1
|
|
105
|
-
|
|
106
|
-
docs_args = []
|
|
107
|
-
if parsed_args.force:
|
|
108
|
-
docs_args += ['--force']
|
|
109
|
-
if docs.main(docs_args) != 0:
|
|
110
|
-
return 1
|
|
111
|
-
|
|
112
|
-
if not compile_less('ui', 'controls', parsed_args):
|
|
113
|
-
return 1;
|
|
114
|
-
if not compile_less('demo', 'demo', parsed_args):
|
|
115
|
-
return 1
|
|
116
|
-
|
|
117
|
-
build_args_with_ui = ['--name', 'ui', '+@complete']
|
|
118
|
-
build_args_with_ui += ['--locales'] + parsed_args.locales
|
|
119
|
-
build_args_without_ui = ['--name', 'compiled', '+@complete', '-@ui']
|
|
120
|
-
|
|
121
|
-
if parsed_args.force:
|
|
122
|
-
build_args_with_ui += ['--force']
|
|
123
|
-
build_args_without_ui += ['--force']
|
|
124
|
-
|
|
125
|
-
# Create the list of build modes to build with. If the list is empty
|
|
126
|
-
# by the end, then populate it with every mode.
|
|
127
|
-
modes = []
|
|
128
|
-
modes += ['debug'] if parsed_args.debug else []
|
|
129
|
-
modes += ['release'] if parsed_args.release else []
|
|
130
|
-
|
|
131
|
-
# If --debug or --release are not given, build with everything.
|
|
132
|
-
if not modes:
|
|
133
|
-
modes += ['debug', 'release']
|
|
134
|
-
|
|
135
|
-
for mode in modes:
|
|
136
|
-
# Complete build includes the UI library, but it is optional and player lib
|
|
137
|
-
# should build and work without it as well.
|
|
138
|
-
# First, build the full build (UI included) and then build excluding UI.
|
|
139
|
-
for build_args in [build_args_with_ui, build_args_without_ui]:
|
|
140
|
-
if build.main(build_args + ['--mode', mode]) != 0:
|
|
141
|
-
return 1
|
|
142
|
-
|
|
143
|
-
is_debug = mode == 'debug'
|
|
144
|
-
if not apps.build_all(parsed_args.force, is_debug):
|
|
145
|
-
return 1
|
|
146
|
-
|
|
147
|
-
return 0
|
|
148
|
-
|
|
149
|
-
if __name__ == '__main__':
|
|
150
|
-
shakaBuildHelpers.run_main(main)
|
package/build/apps.py
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python
|
|
2
|
-
#
|
|
3
|
-
# Copyright 2016 Google LLC
|
|
4
|
-
#
|
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
-
# you may not use this file except in compliance with the License.
|
|
7
|
-
# You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
|
|
17
|
-
"""Build our various applications."""
|
|
18
|
-
|
|
19
|
-
import argparse
|
|
20
|
-
import logging
|
|
21
|
-
import os
|
|
22
|
-
import re
|
|
23
|
-
|
|
24
|
-
import build
|
|
25
|
-
import compiler
|
|
26
|
-
import shakaBuildHelpers
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def compile_demo(force, is_debug):
|
|
30
|
-
"""Compile the demo application.
|
|
31
|
-
|
|
32
|
-
Args:
|
|
33
|
-
force: True to rebuild, False to ignore if no changes are detected.
|
|
34
|
-
is_debug: True to compile for debugging, false for release.
|
|
35
|
-
|
|
36
|
-
Returns:
|
|
37
|
-
True on success, False on failure.
|
|
38
|
-
"""
|
|
39
|
-
logging.info('Compiling the demo app (%s)...',
|
|
40
|
-
'debug' if is_debug else 'release')
|
|
41
|
-
|
|
42
|
-
base = shakaBuildHelpers.get_source_base()
|
|
43
|
-
closure_base_js = shakaBuildHelpers.get_closure_base_js_path()
|
|
44
|
-
get = shakaBuildHelpers.get_all_js_files
|
|
45
|
-
cast_receiver = set(get('demo', 'cast_receiver'))
|
|
46
|
-
files = set(
|
|
47
|
-
get('demo') +
|
|
48
|
-
get('externs') +
|
|
49
|
-
get('ui', 'externs') +
|
|
50
|
-
[closure_base_js]) - cast_receiver
|
|
51
|
-
|
|
52
|
-
# Make sure we don't compile in load.js, which will be used to bootstrap
|
|
53
|
-
# everything else. If we build that into the output, we will get an
|
|
54
|
-
# infinite loop of scripts adding themselves.
|
|
55
|
-
files.remove(os.path.join(base, 'demo', 'load.js'))
|
|
56
|
-
# Remove service_worker.js as well. This executes in a different context.
|
|
57
|
-
files.remove(os.path.join(base, 'demo', 'service_worker.js'))
|
|
58
|
-
# Don't compile in the uncompiled require file.
|
|
59
|
-
files.remove(os.path.join(base, 'demo', 'demo_uncompiled.js'))
|
|
60
|
-
# Add lib/debug/asserts.js, which is required for goog.assert.
|
|
61
|
-
files.add(os.path.join(base, 'lib', 'debug', 'asserts.js'))
|
|
62
|
-
|
|
63
|
-
# Add in the generated externs, so that the demo compilation knows the
|
|
64
|
-
# definitions of the library APIs.
|
|
65
|
-
externs = ('shaka-player.ui.debug.externs.js' if is_debug
|
|
66
|
-
else 'shaka-player.ui.externs.js')
|
|
67
|
-
|
|
68
|
-
files.add(os.path.join(base, 'dist', externs))
|
|
69
|
-
|
|
70
|
-
name = 'demo.compiled' + ('.debug' if is_debug else '')
|
|
71
|
-
|
|
72
|
-
# TODO: Why do we always use debug_closure_opts? Nobody remembers.
|
|
73
|
-
closure_opts = build.common_closure_opts + build.debug_closure_opts
|
|
74
|
-
closure_opts += [
|
|
75
|
-
# Ignore missing goog.require since we assume the whole library is
|
|
76
|
-
# already included.
|
|
77
|
-
'--jscomp_off=missingRequire',
|
|
78
|
-
'-D', 'COMPILED=true',
|
|
79
|
-
]
|
|
80
|
-
|
|
81
|
-
closure = compiler.ClosureCompiler(files, name)
|
|
82
|
-
# The output wrapper is only designed for the library. It can't be used
|
|
83
|
-
# for apps. TODO: Should we add a simple function wrapper for apps?
|
|
84
|
-
closure.add_wrapper = False
|
|
85
|
-
if not closure.compile(closure_opts, force):
|
|
86
|
-
return False
|
|
87
|
-
|
|
88
|
-
return True
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def compile_receiver(force, is_debug):
|
|
92
|
-
"""Compile the cast receiver application.
|
|
93
|
-
|
|
94
|
-
Args:
|
|
95
|
-
force: True to rebuild, False to ignore if no changes are detected.
|
|
96
|
-
is_debug: True to compile for debugging, false for release.
|
|
97
|
-
|
|
98
|
-
Returns:
|
|
99
|
-
True on success, False on failure.
|
|
100
|
-
"""
|
|
101
|
-
logging.info('Compiling the receiver app (%s)...',
|
|
102
|
-
'debug' if is_debug else 'release')
|
|
103
|
-
|
|
104
|
-
base = shakaBuildHelpers.get_source_base()
|
|
105
|
-
closure_base_js = shakaBuildHelpers.get_closure_base_js_path()
|
|
106
|
-
get = shakaBuildHelpers.get_all_js_files
|
|
107
|
-
files = set(get('demo', 'common') +
|
|
108
|
-
get('demo', 'cast_receiver') +
|
|
109
|
-
get('externs') +
|
|
110
|
-
get('ui', 'externs') +
|
|
111
|
-
[closure_base_js])
|
|
112
|
-
|
|
113
|
-
# Add in the generated externs, so that the receiver compilation knows the
|
|
114
|
-
# definitions of the library APIs.
|
|
115
|
-
externs = ('shaka-player.ui.debug.externs.js' if is_debug
|
|
116
|
-
else 'shaka-player.ui.externs.js')
|
|
117
|
-
|
|
118
|
-
files.add(os.path.join(base, 'dist', externs))
|
|
119
|
-
files.add(os.path.join(base, 'lib', 'debug', 'asserts.js'))
|
|
120
|
-
|
|
121
|
-
name = 'receiver.compiled' + ('.debug' if is_debug else '')
|
|
122
|
-
|
|
123
|
-
# TODO: Why do we always use debug_closure_opts? Nobody remembers.
|
|
124
|
-
closure_opts = build.common_closure_opts + build.debug_closure_opts
|
|
125
|
-
closure_opts += [
|
|
126
|
-
# Ignore missing goog.require since we assume the whole library is
|
|
127
|
-
# already included.
|
|
128
|
-
'--jscomp_off=missingRequire',
|
|
129
|
-
'-D', 'COMPILED=true',
|
|
130
|
-
]
|
|
131
|
-
|
|
132
|
-
closure = compiler.ClosureCompiler(files, name)
|
|
133
|
-
# The output wrapper is only designed for the library. It can't be used
|
|
134
|
-
# for apps. TODO: Should we add a simple function wrapper for apps?
|
|
135
|
-
closure.add_wrapper = False
|
|
136
|
-
if not closure.compile(closure_opts, force):
|
|
137
|
-
return False
|
|
138
|
-
|
|
139
|
-
return True
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
def build_all(force, is_debug):
|
|
143
|
-
if not compile_demo(force, is_debug):
|
|
144
|
-
return False
|
|
145
|
-
|
|
146
|
-
if not compile_receiver(force, is_debug):
|
|
147
|
-
return False
|
|
148
|
-
|
|
149
|
-
return True
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
def main(args):
|
|
153
|
-
parser = argparse.ArgumentParser(
|
|
154
|
-
description=__doc__,
|
|
155
|
-
formatter_class=argparse.RawDescriptionHelpFormatter)
|
|
156
|
-
|
|
157
|
-
parser.add_argument(
|
|
158
|
-
'--force',
|
|
159
|
-
'-f',
|
|
160
|
-
help='Force building the library even if no files have changed.',
|
|
161
|
-
action='store_true')
|
|
162
|
-
|
|
163
|
-
parsed_args = parser.parse_args(args)
|
|
164
|
-
|
|
165
|
-
# Make the dist/ folder, ignore errors.
|
|
166
|
-
base = shakaBuildHelpers.get_source_base()
|
|
167
|
-
try:
|
|
168
|
-
os.mkdir(os.path.join(base, 'dist'))
|
|
169
|
-
except OSError:
|
|
170
|
-
pass
|
|
171
|
-
|
|
172
|
-
force = parsed_args.force
|
|
173
|
-
|
|
174
|
-
# Update node modules if needed.
|
|
175
|
-
if not shakaBuildHelpers.update_node_modules():
|
|
176
|
-
return 1
|
|
177
|
-
|
|
178
|
-
for is_debug in [True, False]:
|
|
179
|
-
if not build_all(force, is_debug):
|
|
180
|
-
return 1
|
|
181
|
-
|
|
182
|
-
return 0
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
if __name__ == '__main__':
|
|
186
|
-
shakaBuildHelpers.run_main(main)
|