diff --git a/public/javascripts/spacedeck_directives.js b/public/javascripts/spacedeck_directives.js index 74acae0..63c3621 100644 --- a/public/javascripts/spacedeck_directives.js +++ b/public/javascripts/spacedeck_directives.js @@ -52,9 +52,18 @@ function setup_directives() { } var play_func = function() { - video.play(); - player_state = "playing"; - update_view(); + var playPromise = video.play(); + if (playPromise !== undefined) { + playPromise.then(_ => { + // Automatic playback started! + player_state = "playing"; + update_view(); + }) + .catch(error => { + // Auto-play was prevented + // Show paused UI. + }); + } } var pause_func = function() { diff --git a/public/stylesheets/style.css b/public/stylesheets/style.css index 4a05026..b699787 100644 --- a/public/stylesheets/style.css +++ b/public/stylesheets/style.css @@ -15184,6 +15184,8 @@ button.close { width: 100%; height: 100%; background-size: cover; } + .artifact .video.playing video { + z-index: 1; } .artifact .video .title { position: absolute; bottom: 0px; @@ -15197,13 +15199,15 @@ button.close { font-size: 10px; } .artifact .video video { width: 100%; - height: 100%; } + height: 100%; + position: absolute; } .artifact .video .tl-controls { position: absolute; - bottom: 10px; + top: 10px; left: 10px; right: 10px; - text-align: center; } + text-align: center; + z-index: 2; } .artifact .video .tl-controls .btn { margin-top: 20px; } .artifact .audio { diff --git a/styles/artifact.scss b/styles/artifact.scss index 5267a07..e43ff49 100644 --- a/styles/artifact.scss +++ b/styles/artifact.scss @@ -323,6 +323,12 @@ height: 100%; background-size: cover; + &.playing { + video { + z-index: 1; + } + } + .title { position: absolute; bottom: 0px; @@ -339,14 +345,16 @@ video { width: 100%; height: 100%; + position: absolute; } .tl-controls { position: absolute; - bottom: 10px; + top: 10px; left: 10px; right: 10px; text-align: center; + z-index: 2; .btn { margin-top: 20px; diff --git a/views/partials/space.html b/views/partials/space.html index 02cd2b6..6937a78 100644 --- a/views/partials/space.html +++ b/views/partials/space.html @@ -151,8 +151,8 @@ -
-
@@ -343,4 +342,4 @@ - + \ No newline at end of file