shaka-player 4.4.2 → 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 (57) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/demo/common/asset.js +5 -0
  3. package/demo/common/assets.js +20 -5
  4. package/demo/common/message_ids.js +1 -1
  5. package/demo/locales/en.json +2 -1
  6. package/demo/locales/source.json +5 -1
  7. package/demo/main.js +1 -1
  8. package/demo/search.js +3 -3
  9. package/dist/demo.compiled.debug.js +72 -70
  10. package/dist/demo.compiled.debug.map +3 -3
  11. package/dist/demo.compiled.js +72 -70
  12. package/dist/demo.compiled.map +3 -3
  13. package/dist/locales.js +30 -30
  14. package/dist/receiver.compiled.debug.js +38 -36
  15. package/dist/receiver.compiled.debug.map +3 -3
  16. package/dist/receiver.compiled.js +38 -36
  17. package/dist/receiver.compiled.map +3 -3
  18. package/dist/shaka-player.compiled.d.ts +222 -1
  19. package/dist/shaka-player.compiled.debug.d.ts +222 -1
  20. package/dist/shaka-player.compiled.debug.externs.js +271 -1
  21. package/dist/shaka-player.compiled.debug.js +233 -228
  22. package/dist/shaka-player.compiled.debug.map +3 -3
  23. package/dist/shaka-player.compiled.externs.js +271 -1
  24. package/dist/shaka-player.compiled.js +1035 -1028
  25. package/dist/shaka-player.compiled.map +3 -3
  26. package/dist/shaka-player.ui.d.ts +222 -1
  27. package/dist/shaka-player.ui.debug.d.ts +222 -1
  28. package/dist/shaka-player.ui.debug.externs.js +271 -1
  29. package/dist/shaka-player.ui.debug.js +256 -251
  30. package/dist/shaka-player.ui.debug.map +3 -3
  31. package/dist/shaka-player.ui.externs.js +271 -1
  32. package/dist/shaka-player.ui.js +1162 -1155
  33. package/dist/shaka-player.ui.map +3 -3
  34. package/docs/tutorials/offline.md +1 -1
  35. package/lib/dash/dash_parser.js +4 -1
  36. package/lib/hls/hls_parser.js +60 -24
  37. package/lib/media/segment_index.js +4 -4
  38. package/lib/media/segment_reference.js +6 -1
  39. package/lib/media/streaming_engine.js +14 -24
  40. package/lib/player.js +1 -1
  41. package/lib/text/cue.js +47 -47
  42. package/lib/text/vtt_text_parser.js +2 -2
  43. package/lib/util/cmcd_manager.js +6 -1
  44. package/lib/util/manifest_parser_utils.js +10 -4
  45. package/lib/util/platform.js +14 -0
  46. package/lib/util/ts_parser.js +3 -3
  47. package/package.json +1 -1
  48. package/test/dash/dash_parser_manifest_unit.js +5 -0
  49. package/test/dash/dash_parser_segment_base_unit.js +5 -0
  50. package/test/dash/dash_parser_segment_list_unit.js +21 -17
  51. package/test/dash/dash_parser_segment_template_unit.js +47 -0
  52. package/test/hls/hls_live_unit.js +33 -0
  53. package/test/hls/hls_parser_unit.js +2 -57
  54. package/test/test/util/dash_parser_util.js +16 -7
  55. package/test/text/vtt_text_parser_unit.js +2 -17
  56. package/test/transmuxer/transmuxer_integration.js +4 -4
  57. package/test/util/ts_parser_unit.js +1 -1
@@ -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.