Merge branch 'volume-control' of sanj/padmaEmbeds into master

This commit is contained in:
sanj 2018-03-16 14:32:35 +00:00 committed by Gitea
commit ba2e8e4d75
2 changed files with 8 additions and 4 deletions

View File

@ -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
}

View File

@ -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>