shaka-player 4.9.20 → 4.9.21
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/dist/locales.js +36 -36
- package/dist/shaka-player.compiled.debug.js +12 -10
- package/dist/shaka-player.compiled.debug.map +3 -3
- package/dist/shaka-player.compiled.js +40 -39
- package/dist/shaka-player.compiled.map +3 -3
- package/dist/shaka-player.ui.debug.js +15 -13
- package/dist/shaka-player.ui.debug.map +3 -3
- package/dist/shaka-player.ui.js +37 -36
- package/dist/shaka-player.ui.map +3 -3
- package/lib/media/streaming_engine.js +7 -6
- package/lib/player.js +2 -2
- package/lib/text/ui_text_displayer.js +37 -10
- package/package.json +1 -1
|
@@ -2282,10 +2282,11 @@ shaka.media.StreamingEngine = class {
|
|
|
2282
2282
|
this.playerInterface_.onManifestUpdate();
|
|
2283
2283
|
} else {
|
|
2284
2284
|
// All other schemes are dispatched as a general 'emsg' event.
|
|
2285
|
+
const endTime = startTime + (eventDuration / timescale);
|
|
2285
2286
|
/** @type {shaka.extern.EmsgInfo} */
|
|
2286
2287
|
const emsg = {
|
|
2287
2288
|
startTime: startTime,
|
|
2288
|
-
endTime:
|
|
2289
|
+
endTime: endTime,
|
|
2289
2290
|
schemeIdUri: schemeId,
|
|
2290
2291
|
value: value,
|
|
2291
2292
|
timescale: timescale,
|
|
@@ -2318,17 +2319,17 @@ shaka.media.StreamingEngine = class {
|
|
|
2318
2319
|
schemeId == 'https://developer.apple.com/streaming/emsg-id3') {
|
|
2319
2320
|
// See https://aomediacodec.github.io/id3-emsg/
|
|
2320
2321
|
const frames = shaka.util.Id3Utils.getID3Frames(messageData);
|
|
2321
|
-
if (frames.length
|
|
2322
|
+
if (frames.length) {
|
|
2322
2323
|
/** @private {shaka.extern.ID3Metadata} */
|
|
2323
2324
|
const metadata = {
|
|
2324
|
-
cueTime:
|
|
2325
|
+
cueTime: startTime,
|
|
2325
2326
|
data: messageData,
|
|
2326
2327
|
frames: frames,
|
|
2327
|
-
dts:
|
|
2328
|
-
pts:
|
|
2328
|
+
dts: startTime,
|
|
2329
|
+
pts: startTime,
|
|
2329
2330
|
};
|
|
2330
2331
|
this.playerInterface_.onMetadata(
|
|
2331
|
-
[metadata], /* offset= */ 0,
|
|
2332
|
+
[metadata], /* offset= */ 0, endTime);
|
|
2332
2333
|
}
|
|
2333
2334
|
}
|
|
2334
2335
|
}
|
package/lib/player.js
CHANGED
|
@@ -3019,7 +3019,7 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
|
|
|
3019
3019
|
*/
|
|
3020
3020
|
processTimedMetadataMediaSrc_(metadata, offset, segmentEndTime) {
|
|
3021
3021
|
for (const sample of metadata) {
|
|
3022
|
-
if (sample.data && sample.cueTime && sample.frames) {
|
|
3022
|
+
if (sample.data && typeof(sample.cueTime) == 'number' && sample.frames) {
|
|
3023
3023
|
const start = sample.cueTime + offset;
|
|
3024
3024
|
let end = segmentEndTime;
|
|
3025
3025
|
// This can happen when the ID3 info arrives in a previous segment.
|
|
@@ -7484,7 +7484,7 @@ shaka.Player.TYPICAL_BUFFERING_THRESHOLD_ = 0.5;
|
|
|
7484
7484
|
* @export
|
|
7485
7485
|
*/
|
|
7486
7486
|
// eslint-disable-next-line no-useless-concat
|
|
7487
|
-
shaka.Player.version = 'v4.9.
|
|
7487
|
+
shaka.Player.version = 'v4.9.21' + '-uncompiled'; // x-release-please-version
|
|
7488
7488
|
|
|
7489
7489
|
// Initialize the deprecation system using the version string we just set
|
|
7490
7490
|
// on the player.
|
|
@@ -726,6 +726,15 @@ shaka.text.UITextDisplayer = class {
|
|
|
726
726
|
style.display = 'flex';
|
|
727
727
|
style.flexDirection = 'column';
|
|
728
728
|
style.alignItems = 'center';
|
|
729
|
+
if (cue.textAlign == Cue.textAlign.LEFT ||
|
|
730
|
+
cue.textAlign == Cue.textAlign.START) {
|
|
731
|
+
style.width = '100%';
|
|
732
|
+
style.alignItems = 'start';
|
|
733
|
+
} else if (cue.textAlign == Cue.textAlign.RIGHT ||
|
|
734
|
+
cue.textAlign == Cue.textAlign.END) {
|
|
735
|
+
style.width = '100%';
|
|
736
|
+
style.alignItems = 'end';
|
|
737
|
+
}
|
|
729
738
|
|
|
730
739
|
if (cue.displayAlign == Cue.displayAlign.BEFORE) {
|
|
731
740
|
style.justifyContent = 'flex-start';
|
|
@@ -811,23 +820,41 @@ shaka.text.UITextDisplayer = class {
|
|
|
811
820
|
|
|
812
821
|
style.lineHeight = cue.lineHeight;
|
|
813
822
|
|
|
814
|
-
// The position defines the indent of the text container in the
|
|
815
|
-
// direction defined by the writing direction.
|
|
816
|
-
if (cue.position != null) {
|
|
817
|
-
if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) {
|
|
818
|
-
style.paddingLeft = cue.position;
|
|
819
|
-
} else {
|
|
820
|
-
style.paddingTop = cue.position;
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
|
|
824
823
|
// The positionAlign attribute is an alignment for the text container in
|
|
825
824
|
// the dimension of the writing direction.
|
|
826
825
|
const computedPositionAlign = this.computeCuePositionAlignment_(cue);
|
|
827
826
|
if (computedPositionAlign == Cue.positionAlign.LEFT) {
|
|
828
827
|
style.cssFloat = 'left';
|
|
828
|
+
if (cue.position !== null) {
|
|
829
|
+
style.position = 'absolute';
|
|
830
|
+
if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) {
|
|
831
|
+
style.left = cue.position + '%';
|
|
832
|
+
style.width = 'auto';
|
|
833
|
+
} else {
|
|
834
|
+
style.top = cue.position + '%';
|
|
835
|
+
}
|
|
836
|
+
}
|
|
829
837
|
} else if (computedPositionAlign == Cue.positionAlign.RIGHT) {
|
|
830
838
|
style.cssFloat = 'right';
|
|
839
|
+
if (cue.position !== null) {
|
|
840
|
+
style.position = 'absolute';
|
|
841
|
+
if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) {
|
|
842
|
+
style.right = cue.position + '%';
|
|
843
|
+
style.width = 'auto';
|
|
844
|
+
} else {
|
|
845
|
+
style.bottom = cue.position + '%';
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
} else {
|
|
849
|
+
if (cue.position !== null && cue.position != 50) {
|
|
850
|
+
style.position = 'absolute';
|
|
851
|
+
if (cue.writingMode == Cue.writingMode.HORIZONTAL_TOP_TO_BOTTOM) {
|
|
852
|
+
style.left = cue.position + '%';
|
|
853
|
+
style.width = 'auto';
|
|
854
|
+
} else {
|
|
855
|
+
style.top = cue.position + '%';
|
|
856
|
+
}
|
|
857
|
+
}
|
|
831
858
|
}
|
|
832
859
|
|
|
833
860
|
style.textAlign = cue.textAlign;
|