@gcorevideo/player 2.26.9 → 2.28.0

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/core.js CHANGED
@@ -42654,6 +42654,7 @@ class HTML5Video extends BasePlayback {
42654
42654
  super._onEnded();
42655
42655
  }
42656
42656
  _handleBufferingEvents() {
42657
+ // TODO use the logic from the base class to detect if it's stalled or resumed, because in the latter case the current behavior is not correct
42657
42658
  if (!this.stallTimerId) {
42658
42659
  this.stallTimerId = setTimeout(() => {
42659
42660
  this.stallTimerId = null;
@@ -42908,6 +42909,29 @@ class Player {
42908
42909
  isPlaying() {
42909
42910
  return this.player?.isPlaying() ?? false;
42910
42911
  }
42912
+ /**
42913
+ * Loads new media source
42914
+ * @param mediaSources - list of media sources to use
42915
+ * @beta
42916
+ */
42917
+ load(mediaSources) {
42918
+ if (mediaSources.length === 0) {
42919
+ throw new Error('No media sources provided');
42920
+ }
42921
+ const ms = mediaSources.map((s) => wrapSource(s));
42922
+ const sourceController = this.player?.core.activePlayback.getPlugin('source_controller');
42923
+ if (sourceController) {
42924
+ sourceController.setMediaSource(ms);
42925
+ return;
42926
+ }
42927
+ if (this.player) {
42928
+ this.player.load(ms, ms[0].mimeType ?? '');
42929
+ return;
42930
+ }
42931
+ this.configure({
42932
+ sources: mediaSources,
42933
+ });
42934
+ }
42911
42935
  /**
42912
42936
  * Mutes the sound of the video.
42913
42937
  */
@@ -43179,7 +43203,7 @@ class Player {
43179
43203
  }
43180
43204
  }
43181
43205
 
43182
- var version$1 = "2.26.9";
43206
+ var version$1 = "2.28.0";
43183
43207
 
43184
43208
  var packages = {
43185
43209
  "node_modules/@clappr/core": {