Skip to content

Commit 9fb9d41

Browse files
committed
fix: specify "playlist" key for array of videos as playlist
1 parent 68f8421 commit 9fb9d41

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/PlayerScripts.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ export const MAIN_SCRIPT = (
9595
const list = typeof playList === 'string' ? playList : '';
9696
const listType = typeof playList === 'string' ? 'playlist' : '';
9797
const contentScale_s = typeof contentScale === 'number' ? contentScale : 1.0;
98+
const playlist = Array.isArray(playList)
99+
? `playlist: "${playList.join(',')}",`
100+
: '';
98101

99102
// scale will either be "initial-scale=1.0"
100103
let scale = `initial-scale=${contentScale_s}`;
@@ -149,6 +152,7 @@ export const MAIN_SCRIPT = (
149152
height: '1000',
150153
videoId: '${videoId_s}',
151154
playerVars: {
155+
${playlist}
152156
end: ${end},
153157
rel: ${rel_s},
154158
playsinline: 1,

0 commit comments

Comments
 (0)