Browse Source

Fix youtube loop parameter in Video Component. Fixes #969

pull/1035/head
Artur Arseniev 9 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 * @private
*/ */
getYoutubeSrc() { getYoutubeSrc() {
var url = this.get('ytUrl'); const id = this.get('videoId');
url += this.get('videoId') + '?'; let url = this.get('ytUrl');
url += id + '?';
url += this.get('autoplay') ? '&autoplay=1' : ''; url += this.get('autoplay') ? '&autoplay=1' : '';
url += !this.get('controls') ? '&controls=0' : ''; url += !this.get('controls') ? '&controls=0&showinfo=0' : '';
url += this.get('loop') ? '&loop=1' : ''; // 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; return url;
}, },

Loading…
Cancel
Save