1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-25 11:13:52 +02:00

Added volume() function to get and set volume through the player.

This commit is contained in:
Steve Heffernan 2010-10-20 22:07:38 -07:00
parent c54ad0583b
commit c2c945afe5
3 changed files with 9 additions and 1 deletions

View File

@ -129,6 +129,10 @@ Set options when setting up the videos. The defaults are shown here.
Changelog
---------
1.1.4
- Feature: Added volume() function to get and set volume through the player.
1.1.3
- Feature: Width/Height functions for resizing the player

View File

@ -74,7 +74,7 @@
<video id="example_video_1" class="video-js" width="640" height="264" controls="controls" preload="auto" poster="http://video-js.zencoder.com/oceans-clip.png">
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm; codecs="vp8, vorbis"' />
<source src="http://video-js.zencoder.com/oceans-clip.ogg" type='video/ogg; codecs="theora, vorbis"' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg; codecs="theora, vorbis"' />
<!-- Flash Fallback. Use any flash video player here. Make sure to keep the vjs-flash-fallback class. -->
<object id="flash_fallback_1" class="vjs-flash-fallback" width="640" height="264" type="application/x-shockwave-flash"
data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf">

View File

@ -259,6 +259,10 @@ var VideoJS = JRClass.extend({
this.positionController();
return this;
},
volume: function(newVolume){
if(newVolume != undefined) { this.setVolume(newVolume); }
return this.video.volume;
},
loadInterface: function(){
if(!this.stylesHaveLoaded()) {