shaka-player 4.4.1 → 4.4.3

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.
Files changed (84) hide show
  1. package/.github/workflows/deflake.yaml +8 -5
  2. package/.github/workflows/release-please.yaml +47 -7
  3. package/.github/workflows/shaka-bot-commands/command-test.sh +1 -1
  4. package/CHANGELOG.md +43 -0
  5. package/CONTRIBUTORS +1 -0
  6. package/demo/common/asset.js +5 -0
  7. package/demo/common/assets.js +20 -5
  8. package/demo/common/message_ids.js +1 -1
  9. package/demo/custom.js +5 -5
  10. package/demo/locales/en.json +2 -1
  11. package/demo/locales/source.json +5 -1
  12. package/demo/main.js +1 -1
  13. package/demo/search.js +3 -3
  14. package/dist/demo.compiled.debug.js +75 -73
  15. package/dist/demo.compiled.debug.map +3 -3
  16. package/dist/demo.compiled.js +75 -73
  17. package/dist/demo.compiled.map +3 -3
  18. package/dist/deps.js +2 -2
  19. package/dist/locales.js +31 -31
  20. package/dist/receiver.compiled.debug.js +38 -36
  21. package/dist/receiver.compiled.debug.map +3 -3
  22. package/dist/receiver.compiled.js +38 -36
  23. package/dist/receiver.compiled.map +3 -3
  24. package/dist/shaka-player.compiled.d.ts +533 -296
  25. package/dist/shaka-player.compiled.debug.d.ts +533 -296
  26. package/dist/shaka-player.compiled.debug.externs.js +308 -1
  27. package/dist/shaka-player.compiled.debug.js +280 -265
  28. package/dist/shaka-player.compiled.debug.map +3 -3
  29. package/dist/shaka-player.compiled.externs.js +308 -1
  30. package/dist/shaka-player.compiled.js +1037 -1027
  31. package/dist/shaka-player.compiled.map +4 -4
  32. package/dist/shaka-player.ui.d.ts +577 -340
  33. package/dist/shaka-player.ui.debug.d.ts +577 -340
  34. package/dist/shaka-player.ui.debug.externs.js +308 -1
  35. package/dist/shaka-player.ui.debug.js +341 -326
  36. package/dist/shaka-player.ui.debug.map +3 -3
  37. package/dist/shaka-player.ui.externs.js +308 -1
  38. package/dist/shaka-player.ui.js +1149 -1141
  39. package/dist/shaka-player.ui.map +4 -4
  40. package/docs/tutorials/fairplay.md +8 -0
  41. package/docs/tutorials/faq.md +1 -1
  42. package/docs/tutorials/offline.md +1 -1
  43. package/externs/shaka/text.js +7 -0
  44. package/lib/dash/dash_parser.js +4 -1
  45. package/lib/dash/segment_template.js +3 -0
  46. package/lib/hls/hls_parser.js +68 -28
  47. package/lib/media/media_source_engine.js +1 -1
  48. package/lib/media/segment_index.js +4 -4
  49. package/lib/media/segment_reference.js +6 -1
  50. package/lib/media/streaming_engine.js +14 -24
  51. package/lib/player.js +8 -57
  52. package/lib/text/cue.js +47 -47
  53. package/lib/text/lrc_text_parser.js +8 -0
  54. package/lib/text/mp4_ttml_parser.js +8 -0
  55. package/lib/text/mp4_vtt_parser.js +8 -0
  56. package/lib/text/sbv_text_parser.js +8 -0
  57. package/lib/text/srt_text_parser.js +8 -0
  58. package/lib/text/ssa_text_parser.js +8 -0
  59. package/lib/text/text_engine.js +8 -1
  60. package/lib/text/ttml_text_parser.js +10 -1
  61. package/lib/text/ui_text_displayer.js +49 -3
  62. package/lib/text/vtt_text_parser.js +19 -3
  63. package/lib/transmuxer/ts_transmuxer.js +44 -43
  64. package/lib/util/cmcd_manager.js +6 -1
  65. package/lib/util/error.js +16 -10
  66. package/lib/util/manifest_parser_utils.js +10 -4
  67. package/lib/util/platform.js +14 -0
  68. package/lib/util/player_configuration.js +2 -2
  69. package/lib/util/stream_utils.js +13 -11
  70. package/lib/util/ts_parser.js +73 -16
  71. package/package.json +2 -2
  72. package/test/dash/dash_parser_manifest_unit.js +5 -0
  73. package/test/dash/dash_parser_segment_base_unit.js +5 -0
  74. package/test/dash/dash_parser_segment_list_unit.js +21 -17
  75. package/test/dash/dash_parser_segment_template_unit.js +47 -0
  76. package/test/hls/hls_live_unit.js +33 -0
  77. package/test/hls/hls_parser_unit.js +2 -57
  78. package/test/test/util/dash_parser_util.js +16 -7
  79. package/test/text/text_engine_unit.js +4 -2
  80. package/test/text/ttml_text_parser_unit.js +3 -4
  81. package/test/text/web_vtt_layout_integration.js +0 -1
  82. package/test/transmuxer/transmuxer_integration.js +4 -4
  83. package/test/util/ts_parser_unit.js +1 -1
  84. package/ui/language_utils.js +0 -15
@@ -700,6 +700,212 @@ shaka.text.Cue = class {
700
700
  */
701
701
  static equal(cue1, cue2) {}
702
702
  };
703
+ /**
704
+ * The start time of the cue in seconds, relative to the start of the
705
+ * presentation.
706
+ * @type {number}
707
+ */
708
+ shaka.text.Cue.prototype.startTime;
709
+ /**
710
+ * The end time of the cue in seconds, relative to the start of the
711
+ * presentation.
712
+ * @type {number}
713
+ */
714
+ shaka.text.Cue.prototype.endTime;
715
+ /**
716
+ * The text payload of the cue. If nestedCues is non-empty, this should be
717
+ * empty. Top-level block containers should have no payload of their own.
718
+ * @type {string}
719
+ */
720
+ shaka.text.Cue.prototype.payload;
721
+ /**
722
+ * The region to render the cue into. Only supported on top-level cues,
723
+ * because nested cues are inline elements.
724
+ * @type {shaka.text.CueRegion}
725
+ */
726
+ shaka.text.Cue.prototype.region;
727
+ /**
728
+ * The indent (in percent) of the cue box in the direction defined by the
729
+ * writing direction.
730
+ * @type {?number}
731
+ */
732
+ shaka.text.Cue.prototype.position;
733
+ /**
734
+ * Position alignment of the cue.
735
+ * @type {shaka.text.Cue.positionAlign}
736
+ */
737
+ shaka.text.Cue.prototype.positionAlign;
738
+ /**
739
+ * Size of the cue box (in percents), where 0 means "auto".
740
+ * @type {number}
741
+ */
742
+ shaka.text.Cue.prototype.size;
743
+ /**
744
+ * Alignment of the text inside the cue box.
745
+ * @type {shaka.text.Cue.textAlign}
746
+ */
747
+ shaka.text.Cue.prototype.textAlign;
748
+ /**
749
+ * Text direction of the cue.
750
+ * @type {shaka.text.Cue.direction}
751
+ */
752
+ shaka.text.Cue.prototype.direction;
753
+ /**
754
+ * Text writing mode of the cue.
755
+ * @type {shaka.text.Cue.writingMode}
756
+ */
757
+ shaka.text.Cue.prototype.writingMode;
758
+ /**
759
+ * The way to interpret line field. (Either as an integer line number or
760
+ * percentage from the display box).
761
+ * @type {shaka.text.Cue.lineInterpretation}
762
+ */
763
+ shaka.text.Cue.prototype.lineInterpretation;
764
+ /**
765
+ * The offset from the display box in either number of lines or
766
+ * percentage depending on the value of lineInterpretation.
767
+ * @type {?number}
768
+ */
769
+ shaka.text.Cue.prototype.line;
770
+ /**
771
+ * Separation between line areas inside the cue box in px or em
772
+ * (e.g. '100px'/'100em'). If not specified, this should be no less than
773
+ * the largest font size applied to the text in the cue.
774
+ * @type {string}.
775
+ */
776
+ shaka.text.Cue.prototype.lineHeight;
777
+ /**
778
+ * Line alignment of the cue box.
779
+ * Start alignment means the cue box’s top side (for horizontal cues), left
780
+ * side (for vertical growing right), or right side (for vertical growing
781
+ * left) is aligned at the line.
782
+ * Center alignment means the cue box is centered at the line.
783
+ * End alignment The cue box’s bottom side (for horizontal cues), right side
784
+ * (for vertical growing right), or left side (for vertical growing left) is
785
+ * aligned at the line.
786
+ * @type {shaka.text.Cue.lineAlign}
787
+ */
788
+ shaka.text.Cue.prototype.lineAlign;
789
+ /**
790
+ * Vertical alignments of the cues within their extents.
791
+ * 'BEFORE' means displaying the captions at the top of the text display
792
+ * container box, 'CENTER' means in the middle, 'AFTER' means at the bottom.
793
+ * @type {shaka.text.Cue.displayAlign}
794
+ */
795
+ shaka.text.Cue.prototype.displayAlign;
796
+ /**
797
+ * Text color as a CSS color, e.g. "#FFFFFF" or "white".
798
+ * @type {string}
799
+ */
800
+ shaka.text.Cue.prototype.color;
801
+ /**
802
+ * Text background color as a CSS color, e.g. "#FFFFFF" or "white".
803
+ * @type {string}
804
+ */
805
+ shaka.text.Cue.prototype.backgroundColor;
806
+ /**
807
+ * The URL of the background image, e.g. "data:[mime type];base64,[data]".
808
+ * @type {string}
809
+ */
810
+ shaka.text.Cue.prototype.backgroundImage;
811
+ /**
812
+ * The border around this cue as a CSS border.
813
+ * @type {string}
814
+ */
815
+ shaka.text.Cue.prototype.border;
816
+ /**
817
+ * Text font size in px or em (e.g. '100px'/'100em').
818
+ * @type {string}
819
+ */
820
+ shaka.text.Cue.prototype.fontSize;
821
+ /**
822
+ * Text font weight. Either normal or bold.
823
+ * @type {shaka.text.Cue.fontWeight}
824
+ */
825
+ shaka.text.Cue.prototype.fontWeight;
826
+ /**
827
+ * Text font style. Normal, italic or oblique.
828
+ * @type {shaka.text.Cue.fontStyle}
829
+ */
830
+ shaka.text.Cue.prototype.fontStyle;
831
+ /**
832
+ * Text font family.
833
+ * @type {string}
834
+ */
835
+ shaka.text.Cue.prototype.fontFamily;
836
+ /**
837
+ * Text letter spacing as a CSS letter-spacing value.
838
+ * @type {string}
839
+ */
840
+ shaka.text.Cue.prototype.letterSpacing;
841
+ /**
842
+ * Text line padding as a CSS line-padding value.
843
+ * @type {string}
844
+ */
845
+ shaka.text.Cue.prototype.linePadding;
846
+ /**
847
+ * Opacity of the cue element, from 0-1.
848
+ * @type {number}
849
+ */
850
+ shaka.text.Cue.prototype.opacity;
851
+ /**
852
+ * Text decoration. A combination of underline, overline
853
+ * and line through. Empty array means no decoration.
854
+ * @type {!Array.<!shaka.text.Cue.textDecoration>}
855
+ */
856
+ shaka.text.Cue.prototype.textDecoration;
857
+ /**
858
+ * Text shadow color as a CSS text-shadow value.
859
+ * @type {string}
860
+ */
861
+ shaka.text.Cue.prototype.textShadow;
862
+ /**
863
+ * Text stroke color as a CSS color, e.g. "#FFFFFF" or "white".
864
+ * @type {string}
865
+ */
866
+ shaka.text.Cue.prototype.textStrokeColor;
867
+ /**
868
+ * Text stroke width as a CSS stroke-width value.
869
+ * @type {string}
870
+ */
871
+ shaka.text.Cue.prototype.textStrokeWidth;
872
+ /**
873
+ * Whether or not line wrapping should be applied to the cue.
874
+ * @type {boolean}
875
+ */
876
+ shaka.text.Cue.prototype.wrapLine;
877
+ /**
878
+ * Id of the cue.
879
+ * @type {string}
880
+ */
881
+ shaka.text.Cue.prototype.id;
882
+ /**
883
+ * Nested cues, which should be laid out horizontally in one block.
884
+ * Top-level cues are blocks, and nested cues are inline elements.
885
+ * Cues can be nested arbitrarily deeply.
886
+ * @type {!Array.<!shaka.text.Cue>}
887
+ */
888
+ shaka.text.Cue.prototype.nestedCues;
889
+ /**
890
+ * If true, this represents a container element that is "above" the main
891
+ * cues. For example, the <body> and <div> tags that contain the <p> tags
892
+ * in a TTML file. This controls the flow of the final cues; any nested cues
893
+ * within an "isContainer" cue will be laid out as separate lines.
894
+ * @type {boolean}
895
+ */
896
+ shaka.text.Cue.prototype.isContainer;
897
+ /**
898
+ * Whether or not the cue only acts as a line break between two nested cues.
899
+ * Should only appear in nested cues.
900
+ * @type {boolean}
901
+ */
902
+ shaka.text.Cue.prototype.lineBreak;
903
+ /**
904
+ * The number of horizontal and vertical cells into which the Root Container
905
+ * Region area is divided.
906
+ * @type {{ columns: number, rows: number }}
907
+ */
908
+ shaka.text.Cue.prototype.cellResolution;
703
909
  /**
704
910
  * @enum {string}
705
911
  */
@@ -821,6 +1027,68 @@ shaka.text.CueRegion = class {
821
1027
  /** */
822
1028
  constructor() {}
823
1029
  };
1030
+ /**
1031
+ * Region identifier.
1032
+ * @type {string}
1033
+ */
1034
+ shaka.text.CueRegion.prototype.id;
1035
+ /**
1036
+ * The X offset to start the rendering area in viewportAnchorUnits of the
1037
+ * video width.
1038
+ * @type {number}
1039
+ */
1040
+ shaka.text.CueRegion.prototype.viewportAnchorX;
1041
+ /**
1042
+ * The X offset to start the rendering area in viewportAnchorUnits of the
1043
+ * video height.
1044
+ * @type {number}
1045
+ */
1046
+ shaka.text.CueRegion.prototype.viewportAnchorY;
1047
+ /**
1048
+ * The X offset to start the rendering area in percentage (0-100) of this
1049
+ * region width.
1050
+ * @type {number}
1051
+ */
1052
+ shaka.text.CueRegion.prototype.regionAnchorX;
1053
+ /**
1054
+ * The Y offset to start the rendering area in percentage (0-100) of the
1055
+ * region height.
1056
+ * @type {number}
1057
+ */
1058
+ shaka.text.CueRegion.prototype.regionAnchorY;
1059
+ /**
1060
+ * The width of the rendering area in widthUnits.
1061
+ * @type {number}
1062
+ */
1063
+ shaka.text.CueRegion.prototype.width;
1064
+ /**
1065
+ * The width of the rendering area in heightUnits.
1066
+ * @type {number}
1067
+ */
1068
+ shaka.text.CueRegion.prototype.height;
1069
+ /**
1070
+ * The units (percentage, pixels or lines) the region height is in.
1071
+ * @type {shaka.text.CueRegion.units}
1072
+ */
1073
+ shaka.text.CueRegion.prototype.heightUnits;
1074
+ /**
1075
+ * The units (percentage or pixels) the region width is in.
1076
+ * @type {shaka.text.CueRegion.units}
1077
+ */
1078
+ shaka.text.CueRegion.prototype.widthUnits;
1079
+ /**
1080
+ * The units (percentage or pixels) the region viewportAnchors are in.
1081
+ * @type {shaka.text.CueRegion.units}
1082
+ */
1083
+ shaka.text.CueRegion.prototype.viewportAnchorUnits;
1084
+ /**
1085
+ * If scroll=UP, it means that cues in the region will be added to the
1086
+ * bottom of the region and will push any already displayed cues in the
1087
+ * region up. Otherwise (scroll=NONE) cues will stay fixed at the location
1088
+ * they were first painted in.
1089
+ * @type {shaka.text.CueRegion.scrollMode}
1090
+ */
1091
+ shaka.text.CueRegion.prototype.scroll;
824
1092
  /**
825
1093
  * @enum {number}
826
1094
  */
@@ -1732,8 +2000,10 @@ shaka.media.InitSegmentReference = class {
1732
2000
  * the quality of the media associated with this init segment.
1733
2001
  * @param {(null|number)=} timescale
1734
2002
  * @param {(null|BufferSource)=} segmentData
2003
+ * @param {?shaka.extern.HlsAes128Key=} aes128Key
2004
+ * The segment's AES-128-CBC full segment encryption key and iv.
1735
2005
  */
1736
- constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData) {}
2006
+ constructor(uris, startByte, endByte, mediaQuality, timescale, segmentData, aes128Key) {}
1737
2007
  /**
1738
2008
  * Returns the offset from the start of the resource to the
1739
2009
  * start of the segment.
@@ -2028,6 +2298,11 @@ shaka.util.TsParser = class {
2028
2298
  * @return {{height: ?string, width: ?string}}
2029
2299
  */
2030
2300
  getVideoResolution() {}
2301
+ /**
2302
+ * Return the video information
2303
+ * @return {{height: ?string, width: ?string, codec: ?string}}
2304
+ */
2305
+ getVideoInfo() {}
2031
2306
  /**
2032
2307
  * Check if the passed data corresponds to an MPEG2-TS
2033
2308
  * @param {Uint8Array} data
@@ -4523,6 +4798,10 @@ shaka.text.LrcTextParser = class {
4523
4798
  * @override
4524
4799
  */
4525
4800
  setSequenceMode(sequenceMode) {}
4801
+ /**
4802
+ * @override
4803
+ */
4804
+ setManifestType(manifestType) {}
4526
4805
  /**
4527
4806
  * @override
4528
4807
  */
@@ -4540,6 +4819,10 @@ shaka.text.TtmlTextParser = class {
4540
4819
  * @override
4541
4820
  */
4542
4821
  setSequenceMode(sequenceMode) {}
4822
+ /**
4823
+ * @override
4824
+ */
4825
+ setManifestType(manifestType) {}
4543
4826
  /**
4544
4827
  * @override
4545
4828
  */
@@ -4559,6 +4842,10 @@ shaka.text.Mp4TtmlParser = class {
4559
4842
  * @override
4560
4843
  */
4561
4844
  setSequenceMode(sequenceMode) {}
4845
+ /**
4846
+ * @override
4847
+ */
4848
+ setManifestType(manifestType) {}
4562
4849
  /**
4563
4850
  * @override
4564
4851
  */
@@ -4578,6 +4865,10 @@ shaka.text.VttTextParser = class {
4578
4865
  * @override
4579
4866
  */
4580
4867
  setSequenceMode(sequenceMode) {}
4868
+ /**
4869
+ * @override
4870
+ */
4871
+ setManifestType(manifestType) {}
4581
4872
  /**
4582
4873
  * @override
4583
4874
  */
@@ -4597,6 +4888,10 @@ shaka.text.Mp4VttParser = class {
4597
4888
  * @override
4598
4889
  */
4599
4890
  setSequenceMode(sequenceMode) {}
4891
+ /**
4892
+ * @override
4893
+ */
4894
+ setManifestType(manifestType) {}
4600
4895
  /**
4601
4896
  * @override
4602
4897
  */
@@ -4614,6 +4909,10 @@ shaka.text.SbvTextParser = class {
4614
4909
  * @override
4615
4910
  */
4616
4911
  setSequenceMode(sequenceMode) {}
4912
+ /**
4913
+ * @override
4914
+ */
4915
+ setManifestType(manifestType) {}
4617
4916
  /**
4618
4917
  * @override
4619
4918
  */
@@ -4633,6 +4932,10 @@ shaka.text.SrtTextParser = class {
4633
4932
  * @override
4634
4933
  */
4635
4934
  setSequenceMode(sequenceMode) {}
4935
+ /**
4936
+ * @override
4937
+ */
4938
+ setManifestType(manifestType) {}
4636
4939
  /**
4637
4940
  * @override
4638
4941
  */
@@ -4658,6 +4961,10 @@ shaka.text.SsaTextParser = class {
4658
4961
  * @override
4659
4962
  */
4660
4963
  setSequenceMode(sequenceMode) {}
4964
+ /**
4965
+ * @override
4966
+ */
4967
+ setManifestType(manifestType) {}
4661
4968
  /**
4662
4969
  * @override
4663
4970
  */