@gcorevideo/player 2.27.0 → 2.28.1

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
@@ -42909,6 +42909,33 @@ class Player {
42909
42909
  isPlaying() {
42910
42910
  return this.player?.isPlaying() ?? false;
42911
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
+ trace('load', {
42922
+ mediaSources,
42923
+ player: !!this.player,
42924
+ });
42925
+ if (!this.player) {
42926
+ this.configure({
42927
+ sources: mediaSources,
42928
+ });
42929
+ return;
42930
+ }
42931
+ const ms = mediaSources.map((s) => wrapSource(s));
42932
+ const sourceController = this.player?.core.getPlugin('source_controller');
42933
+ if (sourceController) {
42934
+ sourceController.setMediaSource(ms);
42935
+ return;
42936
+ }
42937
+ this.player?.load(ms, ms[0].mimeType ?? '');
42938
+ }
42912
42939
  /**
42913
42940
  * Mutes the sound of the video.
42914
42941
  */
@@ -43180,7 +43207,7 @@ class Player {
43180
43207
  }
43181
43208
  }
43182
43209
 
43183
- var version$1 = "2.27.0";
43210
+ var version$1 = "2.28.1";
43184
43211
 
43185
43212
  var packages = {
43186
43213
  "node_modules/@clappr/core": {