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);
PLAYER.getVolume(function (v) {
VOLUME = v;
setOpt("volume", VOLUME);
});
}

View File

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

View File

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