Skip to content

Commit ae23c87

Browse files
committed
fix: default playlist widget should be hidden
1 parent b14ef29 commit ae23c87

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/plugins/playlist/playlist.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import isPlainObject from 'lodash/isPlainObject';
21
import { sliceProperties } from 'utils/slicing';
32
import { PLAYER_EVENT } from 'utils/consts';
43
import { getCloudinaryUrl } from 'plugins/cloudinary/common';
@@ -22,7 +21,7 @@ const playlist = (player, options = {}) => {
2221
playlistWidget.dispose();
2322
}
2423

25-
if (isPlainObject(options.playlistWidget)) {
24+
if (options.playlistWidget?.show != false) {
2625
if (player.fluid_) {
2726
options.playlistWidget.fluid = true;
2827
}

src/plugins/playlist/ui/playlist.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,13 @@ class Playlist {
240240
current.recommendations(this._defaultRecommendationsResolver(current));
241241
}
242242

243-
this._context.source(current, { recommendationOptions: { disableAutoShow: true, itemBuilder } });
243+
// Extract source options for analytics
244+
const sourceOptions = current.getInitOptions ? current.getInitOptions() : {};
245+
246+
this._context.source(current, {
247+
...sourceOptions,
248+
recommendationOptions: { disableAutoShow: true, itemBuilder }
249+
});
244250

245251
const eventData = { playlist: this, current, next: this.next() };
246252

src/video-player.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ class VideoPlayer extends Utils.mixin(Eventable) {
603603
}
604604

605605
playlist(sources, options = {}) {
606-
this.playerOptions.playlistWidget = { ...(this.playerOptions.playlistWidget || {}), playlist: true };
606+
this.playerOptions.playlistWidget = { ...(this.playerOptions.playlistWidget || { show: false }), playlist: true };
607607

608608
options = Object.assign({}, options, { playlistWidget: this.playerOptions.playlistWidget });
609609

@@ -616,7 +616,7 @@ class VideoPlayer extends Utils.mixin(Eventable) {
616616
}
617617

618618
playlistByTag(tag, options = {}) {
619-
this.playerOptions.playlistWidget = { ...(this.playerOptions.playlistWidget || {}), playlistByTag: true };
619+
this.playerOptions.playlistWidget = { ...(this.playerOptions.playlistWidget || { show: false}), playlistByTag: true };
620620

621621
options = Object.assign({}, options, { playlistWidget: this.playerOptions.playlistWidget });
622622

0 commit comments

Comments
 (0)