From 18cdcee3c14c881c33cabe74456c1c182e9e6185 Mon Sep 17 00:00:00 2001 From: Sanjay Bhangar Date: Fri, 16 Mar 2018 20:00:57 +0530 Subject: [PATCH] allow setting of volume via data-volume --- example/example.js | 8 ++++++-- example/index.html | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/example/example.js b/example/example.js index ac7c902..e815238 100644 --- a/example/example.js +++ b/example/example.js @@ -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 } diff --git a/example/index.html b/example/index.html index c0b6d34..7af8fed 100644 --- a/example/index.html +++ b/example/index.html @@ -10,7 +10,7 @@
At first, three stories from the year 1950 in Bombay
-
+
@@ -37,7 +37,7 @@ >
-
-- 2.17.1