set inital volume

This commit is contained in:
j 2021-08-04 14:17:27 +02:00
parent 1e0537c95f
commit fa93686845
2 changed files with 5 additions and 3 deletions

View file

@ -32,7 +32,8 @@ Ox.VideoElement = function(options, self) {
autoplay: false, autoplay: false,
loop: false, loop: false,
playbackRate: 1, playbackRate: 1,
items: [] items: [],
volume: 1
}) })
.options(options || {}) .options(options || {})
.update({ .update({
@ -101,7 +102,7 @@ Ox.VideoElement = function(options, self) {
self.$videos = [getVideo(), getVideo()]; self.$videos = [getVideo(), getVideo()];
self.$video = self.$videos[self.currentVideo]; self.$video = self.$videos[self.currentVideo];
self.video = self.$video[0]; self.video = self.$video[0];
self.volume = 1; self.volume = self.options.volume;
self.$brightness = $('<div>').css({ self.$brightness = $('<div>').css({
width: '100%', width: '100%',
height: '100%', height: '100%',

View file

@ -444,7 +444,8 @@ Ox.VideoPlayer = function(options, self) {
self.$video = Ox.VideoElement({ self.$video = Ox.VideoElement({
items: self.video, items: self.video,
loop: self.options.loop, loop: self.options.loop,
playbackRate: self.options.playbackRate playbackRate: self.options.playbackRate,
volume: self.options.volume
}) })
.bindEvent(Ox.extend({ .bindEvent(Ox.extend({
durationchange: durationchange, durationchange: durationchange,