allow setting of volume via data-volume
This commit is contained in:
parent
79c00627a3
commit
18cdcee3c1
|
@ -95,6 +95,7 @@ function load_slide(slide) {
|
|||
var video = slide.querySelector('.video')
|
||||
if (video) {
|
||||
data.video = load_urls(video.dataset)
|
||||
data.videoVolume = video.dataset.volume ? parseFloat(video.dataset.volume) : 1
|
||||
data.container = video
|
||||
|
||||
// assumes documents if length > 1
|
||||
|
@ -105,6 +106,7 @@ function load_slide(slide) {
|
|||
var audio = slide.querySelector('.audio')
|
||||
if (audio) {
|
||||
data.audio = audio.dataset.url // audio does not need to be an array
|
||||
data.audioVolume = audio.dataset.volume ? parseFloat(audio.dataset.volume) : 1
|
||||
data.audioContainer = audio
|
||||
console.log('continue', audio.dataset.continue)
|
||||
data.audioContinue = !!audio.dataset.continue
|
||||
|
@ -173,13 +175,15 @@ function start_zoom(data) {
|
|||
|
||||
function start_video(data) {
|
||||
data.embed.postMessage('options', {
|
||||
'paused': false
|
||||
'paused': false,
|
||||
'volume': data.videoVolume
|
||||
})
|
||||
}
|
||||
|
||||
function start_audio(data) {
|
||||
data.audioEmbed.postMessage('options', {
|
||||
'paused': false
|
||||
'paused': false,
|
||||
'volume': data.audioVolume
|
||||
})
|
||||
activeAudio = data
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<div class="title">
|
||||
At first, three stories from the year 1950 in Bombay
|
||||
</div>
|
||||
<div class="audio" data-continue="true" data-url="https://pad.ma/BVF/editor/F#embed"></div>
|
||||
<div class="audio" data-volume="0.4" data-continue="true" data-url="https://pad.ma/BVF/editor/F#embed"></div>
|
||||
</div>
|
||||
<div class="slide" data-duration="10">
|
||||
<div class="title">
|
||||
|
@ -37,7 +37,7 @@
|
|||
></div>
|
||||
</div>
|
||||
<div class="slide" data-duration="15">
|
||||
<div class="video" data-url_0="https://pad.ma/BVF/editor/F#embed"
|
||||
<div class="video" data-volume="0.9" data-url_0="https://pad.ma/BVF/editor/F#embed"
|
||||
></div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user