Tagged: autoplay video, embed video, Quix, youtube
Posted 6 years, 5 months ago
How to embed video in quix (Video elements) to make it autoplay? I fixed all description but youtube don’t provide autoplay without using <frame
Posted 6 years, 5 months ago
Hi
Quix video element does not support it. Please use custom html element with iframe instead.
Posted 6 years, 5 months ago
Posted 6 years, 5 months ago
I do as they say in instruction- no good results. I even copy the oryginal code from advice and movie does not autoplay correct.
Posted 6 years, 5 months ago
Due to autoplay policy changes, your iframe code should be
<div id="player"></div>
<script>
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'i6qMyrm0JuA',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
function onPlayerReady(event) {
event.target.playVideo();
}
var done = false;
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.PLAYING && !done) {
done = true;
}
}
function stopVideo() {
player.stopVideo();
}
</script>
Just replace videoid with your video id
Refer https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
You must be logged in to reply to this topic.