Хотелось бы узнать, возможно ли (и как) с помощью API YouTube iframe использовать кнопку или ссылку html, внешнюю по отношению к проигрывателю, для включения и выключения звука.Переключатель объема YouTube API
Спасибо,
Mauro
Хотелось бы узнать, возможно ли (и как) с помощью API YouTube iframe использовать кнопку или ссылку html, внешнюю по отношению к проигрывателю, для включения и выключения звука.Переключатель объема YouTube API
Спасибо,
Mauro
см jQuery Youtube Plugin для полной спецификации и загрузки.
можно будет объявить игрока, как это:
jQuery("#youtube-player-container").tubeplayer({
width: 600, // the width of the player
height: 450, // the height of the player
allowFullScreen: "true", // true by default, allow user to go full screen
initialVideo: "DkoeNLuMbcI", // the video that is loaded into the player
preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
onPlay: function(id){}, // after the play method is called
onPause: function(){}, // after the pause method is called
onStop: function(){}, // after the player is stopped
onSeek: function(time){}, // after the video has been seeked to a defined point
onMute: function(){}, // after the player is muted
onUnMute: function(){} // after the player is unmuted
});
Then just add a link with the desired function:
<a href="#" onClick='jQuery("#youtube-player-container").tubeplayer("mute")'>
Mute player
Там нет необходимости использовать какие-либо внешние плагины, так как youtube api уже предоставляет вам 'player.mute()' и 'player.unMute()' для переключения звука и 'player.isMuted()' для проверки состояния звукового канала , Это решение является перекодировкой, когда вы можете использовать простой javascript click event ... – easwee
см [это] (http://www.tikku.com/jquery-youtube-tubeplayer-plugin#tubeplayer_tutorial_1) – CosminO