S
S
ser1972018-06-03 17:19:49
JavaScript
ser197, 2018-06-03 17:19:49

How to make a looped playlist from a video in React?

I am writing an interface for the office in which n videos will be played in a loop (from different sources). React project. Initially used this plugin - react-player. In docks it is written that as a source the array of links can be accepted. But when I try to pass an array, I get an error (below)
Code:

<ReactPlayer
url={['https://www.youtube.com/watch?v=B1exW5oI-TI', 'https://www.youtube.com/watch?v=B1exW5oI-TI']}
loop='true'
controls='true'
playing
/>

TypeError: url.match
is not a function
YouTube.load
c:/works/MBC_Sales/client/mbc-sales/node_modules/react-player/lib/players/YouTube.js:91
91 | var id = url && url.match(MATCH_URL)[1];
92 | if (isReady) {
93 | this.player.cueVideoById({
94 | videoId: id,
Has anyone had a similar problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question