Save volume in localStorage

This commit is contained in:
calzoneman 2014-01-02 00:13:45 -05:00
parent c136d566fe
commit afe14c2128
3 changed files with 7 additions and 5 deletions

View file

@ -1013,6 +1013,7 @@ Callbacks = {
console.log('getting volume for', PLAYER.type); console.log('getting volume for', PLAYER.type);
PLAYER.getVolume(function (v) { PLAYER.getVolume(function (v) {
VOLUME = v; VOLUME = v;
setOpt("volume", VOLUME);
}); });
} }

View file

@ -36,7 +36,6 @@ var CHANNEL = {
}; };
var PLAYER = false; var PLAYER = false;
var VOLUME = 1;
var VIDEOQUALITY = false; var VIDEOQUALITY = false;
var FLUIDLAYOUT = false; var FLUIDLAYOUT = false;
var VWIDTH; var VWIDTH;
@ -124,6 +123,8 @@ var USEROPTS = {
secure_connection : getOrDefault("secure_connection", false) secure_connection : getOrDefault("secure_connection", false)
}; };
var VOLUME = getOrDefault("volume", 1);
var NO_WEBSOCKETS = USEROPTS.altsocket; var NO_WEBSOCKETS = USEROPTS.altsocket;
var Rank = { var Rank = {

View file

@ -174,8 +174,6 @@ var VimeoPlayer = function (data) {
}.bind(self)); }.bind(self));
}; };
self.init();
self.load = function (data) { self.load = function (data) {
self.videoId = data.id; self.videoId = data.id;
self.videoLength = data.seconds; self.videoLength = data.seconds;
@ -217,6 +215,8 @@ var VimeoPlayer = function (data) {
self.setVolume = function (vol) { self.setVolume = function (vol) {
self.player.api("setVolume", vol); self.player.api("setVolume", vol);
}; };
self.init();
}); });
}; };
@ -282,8 +282,6 @@ var VimeoFlashPlayer = function (data) {
}); });
}; };
self.init();
self.load = function (data) { self.load = function (data) {
self.videoId = data.id; self.videoId = data.id;
self.videoLength = data.seconds; self.videoLength = data.seconds;
@ -323,6 +321,8 @@ var VimeoFlashPlayer = function (data) {
self.setVolume = function (vol) { self.setVolume = function (vol) {
self.player.api_setVolume(vol); self.player.api_setVolume(vol);
}; };
self.init();
}; };
var DailymotionPlayer = function (data) { var DailymotionPlayer = function (data) {