Saturday, 15 January 2011

video.js - Video muted by default / Enable audio on fullscreen view only -



video.js - Video muted by default / Enable audio on fullscreen view only -

i read entire api , dozens of related help topics dont manage code help me want.

this need: video muted default. when user click on fullscreen button video played total volume.

how code this?

i understand can mute video adding myplayer.volume(0) this:

<script> var myplayer = _v_("video_1"); myplayer.volume(0); </script>

but how observe whether video in fullscreen or not? found fullscreenchange event on api dont manage implement successfully. help day. give thanks you!

listen fullscreenchange event , check isfullscreen property of player.

var myplayer = _v_("video_1"); myplayer.volume(0); var onfullscreen = function(){ if (this.isfullscreen) { this.volume(1); } else { this.volume(0); } }; myplayer.addevent("fullscreenchange", onfullscreen);

https://github.com/zencoder/video-js/blob/master/docs/api.md

video.js

No comments:

Post a Comment