shaka-player 2.5.4 → 2.5.5
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/.csslintrc +13 -0
- package/CHANGELOG.md +56 -0
- package/build/build.py +4 -1
- package/build/check.py +17 -0
- package/build/compiler.py +40 -0
- package/build/types/core +1 -0
- package/build/types/ui +4 -1
- package/demo/asset_card.js +41 -11
- package/demo/cast_receiver/receiver_app.css +19 -13
- package/demo/close_button.js +0 -6
- package/demo/common/asset.js +6 -1
- package/demo/common/assets.js +72 -14
- package/demo/demo.less +105 -16
- package/demo/index.html +8 -5
- package/demo/load.js +5 -7
- package/demo/main.js +81 -16
- package/dist/.csslintstamp +0 -0
- package/dist/controls.css +1 -1
- package/dist/controls.css.map +1 -1
- package/dist/demo.compiled.debug.js +46 -39
- package/dist/demo.compiled.debug.map +3 -3
- package/dist/demo.compiled.js +46 -39
- package/dist/demo.compiled.map +3 -3
- package/dist/demo.css +1 -1
- package/dist/demo.css.map +1 -1
- package/dist/deps.js +11 -7
- package/dist/receiver.compiled.debug.js +10 -6
- package/dist/receiver.compiled.debug.map +3 -3
- package/dist/receiver.compiled.js +10 -6
- package/dist/receiver.compiled.map +3 -3
- package/dist/shaka-player.compiled.debug.externs.js +123 -92
- package/dist/shaka-player.compiled.debug.js +113 -105
- package/dist/shaka-player.compiled.debug.map +4 -4
- package/dist/shaka-player.compiled.externs.js +123 -92
- package/dist/shaka-player.compiled.js +551 -548
- package/dist/shaka-player.compiled.map +4 -4
- package/dist/shaka-player.ui.debug.externs.js +170 -101
- package/dist/shaka-player.ui.debug.js +187 -188
- package/dist/shaka-player.ui.debug.map +4 -4
- package/dist/shaka-player.ui.externs.js +170 -101
- package/dist/shaka-player.ui.js +651 -651
- package/dist/shaka-player.ui.map +3 -3
- package/docs/tutorials/drm-config.md +1 -0
- package/docs/tutorials/fairplay.md +77 -0
- package/docs/tutorials/index.json +1 -0
- package/docs/tutorials/ui-customization.md +3 -0
- package/docs/tutorials/ui.md +3 -1
- package/externs/mediasession.js +16 -1
- package/externs/shaka/net.js +5 -1
- package/externs/shaka/player.js +136 -90
- package/externs/webkitmediakeys.js +4 -0
- package/lib/dash/content_protection.js +33 -1
- package/lib/dash/dash_parser.js +12 -4
- package/lib/hls/hls_parser.js +20 -4
- package/lib/media/drm_engine.js +29 -2
- package/lib/media/media_source_engine.js +7 -3
- package/lib/media/playhead.js +8 -3
- package/lib/media/streaming_engine.js +24 -8
- package/lib/media/video_wrapper.js +8 -3
- package/lib/net/networking_engine.js +1 -0
- package/lib/player.js +3 -2
- package/lib/polyfill/patchedmediakeys_apple.js +2 -72
- package/lib/util/error.js +12 -0
- package/lib/util/fairplay_utils.js +122 -0
- package/lib/util/player_configuration.js +5 -0
- package/lib/util/pssh.js +41 -0
- package/package.json +4 -3
- package/shaka-player.uncompiled.js +5 -1
- package/test/dash/dash_parser_content_protection_unit.js +35 -1
- package/test/dash/dash_parser_manifest_unit.js +31 -0
- package/test/hls/hls_live_unit.js +7 -1
- package/test/hls/hls_parser_unit.js +50 -0
- package/test/media/media_source_engine_integration.js +12 -0
- package/test/media/playhead_unit.js +2 -0
- package/test/player_external.js +3 -2
- package/test/player_integration.js +75 -0
- package/test/test/externs/jasmine.js +6 -0
- package/test/test/util/test_scheme.js +32 -1
- package/test/test/util/ui_utils.js +41 -0
- package/test/ui/ui_unit.js +129 -3
- package/ui/audio_language_selection.js +17 -96
- package/ui/big_play_button.js +61 -0
- package/ui/controls.js +111 -86
- package/ui/controls.less +3 -5
- package/ui/externs/ui.js +14 -2
- package/ui/fullscreen_button.js +2 -52
- package/ui/less/buttons.less +8 -8
- package/ui/less/containers.less +21 -21
- package/ui/less/general.less +11 -0
- package/ui/less/other_elements.less +2 -1
- package/ui/less/overflow_menu.less +11 -10
- package/ui/less/range_elements.less +6 -0
- package/ui/less/spinner.less +2 -0
- package/ui/pip_button.js +1 -1
- package/ui/{play_pause_button.js → play_button.js} +17 -47
- package/ui/resolution_selection.js +41 -104
- package/ui/seek_bar.js +15 -17
- package/ui/settings_menu.js +113 -0
- package/ui/small_play_button.js +73 -0
- package/ui/text_displayer.js +2 -2
- package/ui/text_selection.js +39 -105
- package/ui/ui.js +12 -0
|
@@ -216,6 +216,8 @@ shaka.util.Error.Code = {
|
|
|
216
216
|
'NO_LICENSE_SERVER_GIVEN': 6012,
|
|
217
217
|
'OFFLINE_SESSION_REMOVED': 6013,
|
|
218
218
|
'EXPIRED': 6014,
|
|
219
|
+
'SERVER_CERTIFICATE_REQUIRED': 6015,
|
|
220
|
+
'INIT_DATA_TRANSFORM_ERROR': 6016,
|
|
219
221
|
'LOAD_INTERRUPTED': 7000,
|
|
220
222
|
'OPERATION_ABORTED': 7001,
|
|
221
223
|
'NO_VIDEO_ELEMENT': 7002,
|
|
@@ -571,6 +573,35 @@ shaka.util.EventManager = class {
|
|
|
571
573
|
* @typedef {function(!Event)}
|
|
572
574
|
*/
|
|
573
575
|
shaka.util.EventManager.ListenerType;
|
|
576
|
+
/**
|
|
577
|
+
* @summary A set of FairPlay utility functions.
|
|
578
|
+
*/
|
|
579
|
+
shaka.util.FairPlayUtils = class {
|
|
580
|
+
/**
|
|
581
|
+
* Using the default method, extract a content ID from the init data. This is
|
|
582
|
+
* based on the FairPlay example documentation.
|
|
583
|
+
* @param {!BufferSource} initData
|
|
584
|
+
* @return {string}
|
|
585
|
+
*/
|
|
586
|
+
static defaultGetContentId(initData) {}
|
|
587
|
+
/**
|
|
588
|
+
* Transforms the init data buffer using the given data. The format is:
|
|
589
|
+
* <pre>
|
|
590
|
+
* [4 bytes] initDataSize
|
|
591
|
+
* [initDataSize bytes] initData
|
|
592
|
+
* [4 bytes] contentIdSize
|
|
593
|
+
* [contentIdSize bytes] contentId
|
|
594
|
+
* [4 bytes] certSize
|
|
595
|
+
* [certSize bytes] cert
|
|
596
|
+
* </pre>
|
|
597
|
+
* @param {!BufferSource} initData
|
|
598
|
+
* @param {!BufferSource|string} contentId
|
|
599
|
+
* @param {?BufferSource} cert The server certificate; this will throw if not
|
|
600
|
+
* provided.
|
|
601
|
+
* @return {!Uint8Array}
|
|
602
|
+
*/
|
|
603
|
+
static initDataTransform(initData,contentId,cert) {}
|
|
604
|
+
};
|
|
574
605
|
/**
|
|
575
606
|
* Creates a string from the given buffer as UTF-8 encoding.
|
|
576
607
|
* @param {?BufferSource} data
|
|
@@ -1098,98 +1129,6 @@ shaka.cast.CastReceiver.prototype.isIdle = function() {};
|
|
|
1098
1129
|
* @override
|
|
1099
1130
|
*/
|
|
1100
1131
|
shaka.cast.CastReceiver.prototype.destroy = function() {};
|
|
1101
|
-
/**
|
|
1102
|
-
* Creates an InitSegmentReference, which provides the location to an
|
|
1103
|
-
* initialization segment.
|
|
1104
|
-
* @param {function():!Array.<string>} uris A function that creates the URIs of
|
|
1105
|
-
* the resource containing the segment.
|
|
1106
|
-
* @param {number} startByte The offset from the start of the resource to the
|
|
1107
|
-
* start of the segment.
|
|
1108
|
-
* @param {?number} endByte The offset from the start of the resource to the
|
|
1109
|
-
* end of the segment, inclusive. A value of null indicates that the segment
|
|
1110
|
-
* extends to the end of the resource.
|
|
1111
|
-
* @constructor
|
|
1112
|
-
* @struct
|
|
1113
|
-
*/
|
|
1114
|
-
shaka.media.InitSegmentReference = function(uris, startByte, endByte) {};
|
|
1115
|
-
/**
|
|
1116
|
-
* Creates the URIs of the resource containing the segment.
|
|
1117
|
-
* @return {!Array.<string>}
|
|
1118
|
-
*/
|
|
1119
|
-
shaka.media.InitSegmentReference.prototype.createUris = function() {};
|
|
1120
|
-
/**
|
|
1121
|
-
* Returns the offset from the start of the resource to the
|
|
1122
|
-
* start of the segment.
|
|
1123
|
-
* @return {number}
|
|
1124
|
-
*/
|
|
1125
|
-
shaka.media.InitSegmentReference.prototype.getStartByte = function() {};
|
|
1126
|
-
/**
|
|
1127
|
-
* Returns the offset from the start of the resource to the end of the segment,
|
|
1128
|
-
* inclusive. A value of null indicates that the segment extends to the end of
|
|
1129
|
-
* the resource.
|
|
1130
|
-
* @return {?number}
|
|
1131
|
-
*/
|
|
1132
|
-
shaka.media.InitSegmentReference.prototype.getEndByte = function() {};
|
|
1133
|
-
/**
|
|
1134
|
-
* Creates a SegmentReference, which provides the start time, end time, and
|
|
1135
|
-
* location to a media segment.
|
|
1136
|
-
* @param {number} position The segment's position within a particular Period.
|
|
1137
|
-
* The following should hold true between any two SegmentReferences from the
|
|
1138
|
-
* same Period, r1 and r2:
|
|
1139
|
-
* IF r2.position > r1.position THEN
|
|
1140
|
-
* [ (r2.startTime > r1.startTime) OR
|
|
1141
|
-
* (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]
|
|
1142
|
-
* @param {number} startTime The segment's start time in seconds, relative to
|
|
1143
|
-
* the start of a particular Period.
|
|
1144
|
-
* @param {number} endTime The segment's end time in seconds, relative to
|
|
1145
|
-
* the start of a particular Period. The segment ends the instant before
|
|
1146
|
-
* this time, so |endTime| must be strictly greater than |startTime|.
|
|
1147
|
-
* @param {function():!Array.<string>} uris
|
|
1148
|
-
* A function that creates the URIs of the resource containing the segment.
|
|
1149
|
-
* @param {number} startByte The offset from the start of the resource to the
|
|
1150
|
-
* start of the segment.
|
|
1151
|
-
* @param {?number} endByte The offset from the start of the resource to the
|
|
1152
|
-
* end of the segment, inclusive. A value of null indicates that the segment
|
|
1153
|
-
* extends to the end of the resource.
|
|
1154
|
-
* @constructor
|
|
1155
|
-
* @struct
|
|
1156
|
-
*/
|
|
1157
|
-
shaka.media.SegmentReference = function(position, startTime, endTime, uris, startByte, endByte) {};
|
|
1158
|
-
/**
|
|
1159
|
-
* Returns the segment's position within a particular Period.
|
|
1160
|
-
* @return {number} The segment's position.
|
|
1161
|
-
*/
|
|
1162
|
-
shaka.media.SegmentReference.prototype.getPosition = function() {};
|
|
1163
|
-
/**
|
|
1164
|
-
* Returns the segment's start time in seconds, relative to
|
|
1165
|
-
* the start of a particular Period.
|
|
1166
|
-
* @return {number}
|
|
1167
|
-
*/
|
|
1168
|
-
shaka.media.SegmentReference.prototype.getStartTime = function() {};
|
|
1169
|
-
/**
|
|
1170
|
-
* Returns the segment's end time in seconds, relative to
|
|
1171
|
-
* the start of a particular Period.
|
|
1172
|
-
* @return {number}
|
|
1173
|
-
*/
|
|
1174
|
-
shaka.media.SegmentReference.prototype.getEndTime = function() {};
|
|
1175
|
-
/**
|
|
1176
|
-
* Creates the URIs of the resource containing the segment.
|
|
1177
|
-
* @return {!Array.<string>}
|
|
1178
|
-
*/
|
|
1179
|
-
shaka.media.SegmentReference.prototype.createUris = function() {};
|
|
1180
|
-
/**
|
|
1181
|
-
* Returns the offset from the start of the resource to the
|
|
1182
|
-
* start of the segment.
|
|
1183
|
-
* @return {number}
|
|
1184
|
-
*/
|
|
1185
|
-
shaka.media.SegmentReference.prototype.getStartByte = function() {};
|
|
1186
|
-
/**
|
|
1187
|
-
* Returns the offset from the start of the resource to the end of the segment,
|
|
1188
|
-
* inclusive. A value of null indicates that the segment extends to the end of
|
|
1189
|
-
* the resource.
|
|
1190
|
-
* @return {?number}
|
|
1191
|
-
*/
|
|
1192
|
-
shaka.media.SegmentReference.prototype.getEndByte = function() {};
|
|
1193
1132
|
/**
|
|
1194
1133
|
* Creates a DataViewReader, which abstracts a DataView object.
|
|
1195
1134
|
* @param {!DataView} dataView The DataView.
|
|
@@ -1358,6 +1297,98 @@ shaka.util.Mp4Parser.allData = function(callback) {};
|
|
|
1358
1297
|
* @return {string}
|
|
1359
1298
|
*/
|
|
1360
1299
|
shaka.util.Mp4Parser.typeToString = function(type) {};
|
|
1300
|
+
/**
|
|
1301
|
+
* Creates an InitSegmentReference, which provides the location to an
|
|
1302
|
+
* initialization segment.
|
|
1303
|
+
* @param {function():!Array.<string>} uris A function that creates the URIs of
|
|
1304
|
+
* the resource containing the segment.
|
|
1305
|
+
* @param {number} startByte The offset from the start of the resource to the
|
|
1306
|
+
* start of the segment.
|
|
1307
|
+
* @param {?number} endByte The offset from the start of the resource to the
|
|
1308
|
+
* end of the segment, inclusive. A value of null indicates that the segment
|
|
1309
|
+
* extends to the end of the resource.
|
|
1310
|
+
* @constructor
|
|
1311
|
+
* @struct
|
|
1312
|
+
*/
|
|
1313
|
+
shaka.media.InitSegmentReference = function(uris, startByte, endByte) {};
|
|
1314
|
+
/**
|
|
1315
|
+
* Creates the URIs of the resource containing the segment.
|
|
1316
|
+
* @return {!Array.<string>}
|
|
1317
|
+
*/
|
|
1318
|
+
shaka.media.InitSegmentReference.prototype.createUris = function() {};
|
|
1319
|
+
/**
|
|
1320
|
+
* Returns the offset from the start of the resource to the
|
|
1321
|
+
* start of the segment.
|
|
1322
|
+
* @return {number}
|
|
1323
|
+
*/
|
|
1324
|
+
shaka.media.InitSegmentReference.prototype.getStartByte = function() {};
|
|
1325
|
+
/**
|
|
1326
|
+
* Returns the offset from the start of the resource to the end of the segment,
|
|
1327
|
+
* inclusive. A value of null indicates that the segment extends to the end of
|
|
1328
|
+
* the resource.
|
|
1329
|
+
* @return {?number}
|
|
1330
|
+
*/
|
|
1331
|
+
shaka.media.InitSegmentReference.prototype.getEndByte = function() {};
|
|
1332
|
+
/**
|
|
1333
|
+
* Creates a SegmentReference, which provides the start time, end time, and
|
|
1334
|
+
* location to a media segment.
|
|
1335
|
+
* @param {number} position The segment's position within a particular Period.
|
|
1336
|
+
* The following should hold true between any two SegmentReferences from the
|
|
1337
|
+
* same Period, r1 and r2:
|
|
1338
|
+
* IF r2.position > r1.position THEN
|
|
1339
|
+
* [ (r2.startTime > r1.startTime) OR
|
|
1340
|
+
* (r2.startTime == r1.startTime AND r2.endTime >= r1.endTime) ]
|
|
1341
|
+
* @param {number} startTime The segment's start time in seconds, relative to
|
|
1342
|
+
* the start of a particular Period.
|
|
1343
|
+
* @param {number} endTime The segment's end time in seconds, relative to
|
|
1344
|
+
* the start of a particular Period. The segment ends the instant before
|
|
1345
|
+
* this time, so |endTime| must be strictly greater than |startTime|.
|
|
1346
|
+
* @param {function():!Array.<string>} uris
|
|
1347
|
+
* A function that creates the URIs of the resource containing the segment.
|
|
1348
|
+
* @param {number} startByte The offset from the start of the resource to the
|
|
1349
|
+
* start of the segment.
|
|
1350
|
+
* @param {?number} endByte The offset from the start of the resource to the
|
|
1351
|
+
* end of the segment, inclusive. A value of null indicates that the segment
|
|
1352
|
+
* extends to the end of the resource.
|
|
1353
|
+
* @constructor
|
|
1354
|
+
* @struct
|
|
1355
|
+
*/
|
|
1356
|
+
shaka.media.SegmentReference = function(position, startTime, endTime, uris, startByte, endByte) {};
|
|
1357
|
+
/**
|
|
1358
|
+
* Returns the segment's position within a particular Period.
|
|
1359
|
+
* @return {number} The segment's position.
|
|
1360
|
+
*/
|
|
1361
|
+
shaka.media.SegmentReference.prototype.getPosition = function() {};
|
|
1362
|
+
/**
|
|
1363
|
+
* Returns the segment's start time in seconds, relative to
|
|
1364
|
+
* the start of a particular Period.
|
|
1365
|
+
* @return {number}
|
|
1366
|
+
*/
|
|
1367
|
+
shaka.media.SegmentReference.prototype.getStartTime = function() {};
|
|
1368
|
+
/**
|
|
1369
|
+
* Returns the segment's end time in seconds, relative to
|
|
1370
|
+
* the start of a particular Period.
|
|
1371
|
+
* @return {number}
|
|
1372
|
+
*/
|
|
1373
|
+
shaka.media.SegmentReference.prototype.getEndTime = function() {};
|
|
1374
|
+
/**
|
|
1375
|
+
* Creates the URIs of the resource containing the segment.
|
|
1376
|
+
* @return {!Array.<string>}
|
|
1377
|
+
*/
|
|
1378
|
+
shaka.media.SegmentReference.prototype.createUris = function() {};
|
|
1379
|
+
/**
|
|
1380
|
+
* Returns the offset from the start of the resource to the
|
|
1381
|
+
* start of the segment.
|
|
1382
|
+
* @return {number}
|
|
1383
|
+
*/
|
|
1384
|
+
shaka.media.SegmentReference.prototype.getStartByte = function() {};
|
|
1385
|
+
/**
|
|
1386
|
+
* Returns the offset from the start of the resource to the end of the segment,
|
|
1387
|
+
* inclusive. A value of null indicates that the segment extends to the end of
|
|
1388
|
+
* the resource.
|
|
1389
|
+
* @return {?number}
|
|
1390
|
+
*/
|
|
1391
|
+
shaka.media.SegmentReference.prototype.getEndByte = function() {};
|
|
1361
1392
|
/**
|
|
1362
1393
|
* Creates a SegmentIndex.
|
|
1363
1394
|
* @param {!Array.<!shaka.media.SegmentReference>} references The list of
|