Browse Source

Fix youtube loop parameter in Video Component. Fixes #969

pull/1035/head
Artur Arseniev 8 years ago
parent
commit
bee57c85fc
  1. 11
      src/dom_components/model/ComponentVideo.js

11
src/dom_components/model/ComponentVideo.js

@ -263,11 +263,14 @@ module.exports = Component.extend(
* @private
*/
getYoutubeSrc() {
var url = this.get('ytUrl');
url += this.get('videoId') + '?';
const id = this.get('videoId');
let url = this.get('ytUrl');
url += id + '?';
url += this.get('autoplay') ? '&autoplay=1' : '';
url += !this.get('controls') ? '&controls=0' : '';
url += this.get('loop') ? '&loop=1' : '';
url += !this.get('controls') ? '&controls=0&showinfo=0' : '';
// Loop works only with playlist enabled
// https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work
url += this.get('loop') ? `&loop=1&playlist=${id}` : '';
return url;
},

Loading…
Cancel
Save