Javascript 可以将fitVids或fluidVids与YouTube iFrame API一起使用吗?
我已经能够呈现视频没有问题,除了我还没有发现可以使用fitVids或fluidVids播放器。我假设这是因为Iframe是由JavaScript生成的,不可用于调整大小的脚本。有可能的解决办法吗Javascript 可以将fitVids或fluidVids与YouTube iFrame API一起使用吗?,javascript,iframe,youtube,Javascript,Iframe,Youtube,我已经能够呈现视频没有问题,除了我还没有发现可以使用fitVids或fluidVids播放器。我假设这是因为Iframe是由JavaScript生成的,不可用于调整大小的脚本。有可能的解决办法吗 var youTubeApi = { player: '', init: function(){ // Let's get the API script $.getScript('//www.youtube.com/iframe_api');
var youTubeApi = {
player: '',
init: function(){
// Let's get the API script
$.getScript('//www.youtube.com/iframe_api');
// The API will ask for the player
youTubeApi.createPlayer();
},
createPlayer: function(){
onYouTubeIframeAPIReady = function(){
youTubeApi.player = new YT.Player('player',{
videoId: 'sF4fn82tWmQ',
playerVars:{
autoplay: 1,
autohide: 1
}
})
}
}
}
youTubeApi.init();
谢谢 在加载Youtube iframe后,检查是否正在初始化FluidVids
fluidvids.init();