Skip to content

Commit

Permalink
fix: specify "playlist" key for array of videos as playlist
Browse files Browse the repository at this point in the history
  • Loading branch information
LonelyCpp committed Jan 17, 2021
1 parent 35fc852 commit 0564f65
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PlayerScripts.js
Expand Up @@ -99,6 +99,9 @@ export const MAIN_SCRIPT = (
const list = typeof playList === 'string' ? playList : '';
const listType = typeof playList === 'string' ? 'playlist' : '';
const contentScale_s = typeof contentScale === 'number' ? contentScale : 1.0;
const playlist = Array.isArray(playList)
? `playlist: "${playList.join(',')}",`
: '';

// scale will either be "initial-scale=1.0"
let scale = `initial-scale=${contentScale_s}`;
Expand Down Expand Up @@ -153,6 +156,7 @@ export const MAIN_SCRIPT = (
height: '1000',
videoId: '${videoId_s}',
playerVars: {
${playlist}
end: ${end},
rel: ${rel_s},
playsinline: 1,
Expand Down

0 comments on commit 0564f65

Please sign in to comment.