Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Volume Control Value


Hi, I am wondering if ...Hi, I am wondering if its possible the volume value a user selects when watches a video tou be stored somewow and the next video wathes (on another page) has the selected value by default.
So if he navigates through different pages wont have to set the volume eachtime.
I am using version 3(the last one)

Thanks

16 Community Answers

JW Player

User  
0 rated :

You can set the volume by using Flashvar in the new player (v4.0). Check out this page: *http://code.longtailvideo.com/trac/wiki/FlashVars*
bc.. s1.addVariable('volume', '100');

JW Player

User  
0 rated :

The volume value is stored in a cookie on the user's computer so it will be set to the stored value the next time that the user accesses your page.

JW Player

User  
0 rated :

sorry that cookie thing does not work with me (cookies are enabled in my explorer), Do i have to use a flashvar to enable it? Or it should be working by default ?

JW Player

User  
0 rated :

It should be working by default.

JW Player

User  
0 rated :

I just made a new thread about this, (sorry I searched for sound instead of volume) anyways I'm having the same problem, the volume level does not get stored.

JW Player

User  
0 rated :

Hi,

have the same problem. The volume isn't stored in a cookie (I checked it out in FF and IE) so the volume has to be adjusted everytime when watching a video. The 3.14 Player is able to keep the Volume, but since I updated to 4.1, it doesn' work anymore.

JW Player

User  
0 rated :

Nothing?

JW Player

User  
0 rated :

What is it with you guys? No response in five days... Is it a bug or not?

JW Player

User  
0 rated :

Should I bother writing js and everything for this, or is this built in?

JW Player

User  
0 rated :


Ummmmmmmmmmmmmmmm........... Cookies :D

JW Player

User  
0 rated :

Does anyone has an complete example of the cookie volume ?
How to append this to the player output ?

JW Player

User  
0 rated :

Add these two lines to the playerReady(obj) function to set the volume/mute upon loading:



mute=setTimeout ("player.sendEvent('MUTE',readCookie('video_mute'));",1000);
volume=setTimeout ("player.sendEvent('VOLUME',readCookie('video_volume'));",1000);



-JoeJoe

JW Player

User  
0 rated :

What is a playerReady(obj) function?

Guys, in laymens terms, how do I get this to work, having to adjust volume on every video is about as retarted as it gets!!

JW Player

User  
0 rated :

The above script is a bad solution, it locks visitors in to whatever they first set the volume at, what if they want to change it?

Anybody out there who is serious about this issue????????????????????????

Anybody??????????????????????????????


Todd

JW Player

User  
0 rated :

computer says yes.
------
bc.. cookieFuncs.js
/* functions to read/write browser cookies via http://www.quirksmode.org/js/cookies.html */

function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}
-----
below the player:
<script type="text/javascript">
function muteTracker(obj) {
createCookie('video_mute',obj.state,730);
//var x = readCookie('video_mute');
//alert('the new mute state is: '+x);
};
function volumeTracker(obj) {
createCookie('video_volume',obj.percentage,730);
//var x = readCookie('video_volume');
//alert('the new volume is: '+x);
};
var player;
function playerReady(obj) {
var id = obj['id'];
var version = obj['version'];
var client = obj['client'];
//alert('the videoplayer '+id+' has been instantiated');
player = document.getElementById(id);
player.addControllerListener("MUTE","muteTracker");
player.addViewListener("VOLUME","volumeTracker");
};
//var player = document.getElementById('playerID');

</script>

----
awesome, then grab the cookie value and append it to the player output.


your welcome

JW Player

User  
0 rated :

Big thanks to whoever posted the code here. I was trying to add listeners before the player was initialized but now I'm using the playerReady function to do the hookup.

This question has received the maximum number of answers.