Skip to content

Commit 0564f65

Browse files
committed
fix: specify "playlist" key for array of videos as playlist
1 parent 35fc852 commit 0564f65

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
@@ -99,6 +99,9 @@ export const MAIN_SCRIPT = (
9999
const list = typeof playList === 'string' ? playList : '';
100100
const listType = typeof playList === 'string' ? 'playlist' : '';
101101
const contentScale_s = typeof contentScale === 'number' ? contentScale : 1.0;
102+
const playlist = Array.isArray(playList)
103+
? `playlist: "${playList.join(',')}",`
104+
: '';
102105

103106
// scale will either be "initial-scale=1.0"
104107
let scale = `initial-scale=${contentScale_s}`;
@@ -153,6 +156,7 @@ export const MAIN_SCRIPT = (
153156
height: '1000',
154157
videoId: '${videoId_s}',
155158
playerVars: {
159+
${playlist}
156160
end: ${end},
157161
rel: ${rel_s},
158162
playsinline: 1,

0 commit comments

Comments
 (0)