-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathtransmuxer_worker.uncompiled.js
More file actions
66 lines (58 loc) · 2.48 KB
/
Copy pathtransmuxer_worker.uncompiled.js
File metadata and controls
66 lines (58 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*! @license
* Shaka Player
* Copyright 2016 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @fileoverview Entry point for the transmuxer Web Worker in uncompiled
* (development) mode. Loads Closure Library via importScripts, pulls in the
* dependency graph, then goog.require's the transmuxer plugins and the worker
* entry point.
*
* In compiled builds this file is not used — the compiled bundle is loaded
* directly as the Worker script.
*/
// Closure's base.js uses document.currentScript (or document.write) to resolve
// relative paths. Neither exists inside a Worker, so we provide a
// CLOSURE_IMPORT_SCRIPT hook that uses importScripts instead, and set
// CLOSURE_BASE_PATH so Closure can find its own modules.
/* eslint-disable no-restricted-syntax */
// @ts-ignore
self.CLOSURE_BASE_PATH =
'node_modules/google-closure-library/closure/goog/';
// Tell Closure to use importScripts for loading dependencies.
self.CLOSURE_IMPORT_SCRIPT = (src) => {
importScripts(src);
return true;
};
// Load Closure Library base and the generated dependency map.
importScripts(
'node_modules/google-closure-library/closure/goog/base.js',
'dist/deps.js');
// Pull in all device plugins so DeviceFactory.getDevice() returns the correct
// device inside the worker (needed by Ac3Transmuxer and MimeUtils codec
// conversion). Without these, getDevice() always returns DefaultBrowser even
// on Tizen/WebOS/Xbox/etc.
goog.require('shaka.device.AppleBrowser');
goog.require('shaka.device.Chromecast');
goog.require('shaka.device.DefaultBrowser');
goog.require('shaka.device.Hisense');
goog.require('shaka.device.PlayStation');
goog.require('shaka.device.TitanOS');
goog.require('shaka.device.Tizen');
goog.require('shaka.device.Vizio');
goog.require('shaka.device.WebKitSTB');
goog.require('shaka.device.WebOS');
goog.require('shaka.device.Xbox');
// Pull in the transmuxer plugins so they self-register with
// TransmuxerEngine, then load the worker entry point.
goog.require('shaka.transmuxer.AacTransmuxer');
goog.require('shaka.transmuxer.Ac3Transmuxer');
goog.require('shaka.transmuxer.Ec3Transmuxer');
goog.require('shaka.transmuxer.LocTransmuxer');
goog.require('shaka.transmuxer.Mp3Transmuxer');
goog.require('shaka.transmuxer.MpegTsTransmuxer');
goog.require('shaka.transmuxer.TsTransmuxer');
goog.require('shaka.transmuxer.TransmuxerWorker');
// The auto-boot at the bottom of transmuxer_worker.js will have already
// called TransmuxerWorker.boot() when it was loaded by goog.require above.