2
Guys with a problem here with youtube videos, I have it as option music player on the site in the bottom right, it works normal except on iOS mobile devices, what happens is that I can not play music.
Follow one of the sites that contains the player. website
player = new YT.Player(attrs.container, {
height: '200',
width: '200',
videoId: getIdFromUrl(videoUrl),
playerVars: {
html5: 1,
enablejsapi: 1,
playsinline: 1
//origin: extraService.site_root_url.replace('http:', 'https:')
//origin: extraService.site_root_url
},
events: {
'onReady': onPlayerReady,
'onStateChange': onStateChange
}
});
this is the iframe he generates for me:
<iframe id="sdn-player" frameborder="0" allowfullscreen="1" title="YouTube video player" width="200" height="200" src="https://www.youtube.com/embed/2RtzSLLngc8?enablejsapi=1&playsinline=1&origin=https%3A%2F%2Fnoivos.casar.com"></iframe>
You use some function to give play ?
– Diego Souza
Place the property in your CSS
cursor:pointer:
on the Play button.– Diego Souza
already have this css on the button
– Victor Saul
Sorry, I didn’t mean to offend you. Put that variable
html5: 1,
within theplayerVars
. And put in your POST the functionsOnPlayerReady
andOnStateChange
.– Diego Souza
@Diego-Souza did not understand the part of the POST
– Victor Saul
POST is what you posted here on the site. Edit your question and put the functions I said so we can see what they perform
– Diego Souza
But the functions Onplayerready and Onstatechange already have, this at the end in Events
– Victor Saul
You didn’t put the comma after the
html5: 1
.– Diego Souza
ready I put the comma
– Victor Saul
The problem is where @Diego Souza spoke, is missing a comma in the
html5: 1
, ends up generating a javascript error.onPlayerReady
andonStateChange
are just callbacks– Jeferson Assis
Even with Html5: 1, it didn’t work, the player still doesn’t run on iOS and only this player that doesn’t run, because putting a normal video on the page it runs.
– Victor Saul