From fcfc2de5e45c04036bf12300b5fb03f8253bbcb5 Mon Sep 17 00:00:00 2001 From: Wolfram Hofmeister Date: Thu, 16 Sep 2021 11:26:57 +0200 Subject: [PATCH] Re-enable VR demo on iOS devices --- player/vr-360/css/style.css | 24 ------------ player/vr-360/js/script.js | 76 ++++++++++++------------------------- 2 files changed, 25 insertions(+), 75 deletions(-) diff --git a/player/vr-360/css/style.css b/player/vr-360/css/style.css index 7603d140..b9249c98 100644 --- a/player/vr-360/css/style.css +++ b/player/vr-360/css/style.css @@ -10,23 +10,6 @@ div.input-hint { display: none; } -#player.is-unsupported { - height: 100%; - margin: 15px 0; -} - -#player.is-unsupported #player-container { - min-height: 150px; - min-width: 260px; - display: flex; - align-items: center; -} - -.message-not-supported { - padding: 0 60px; - font-size: 18px; -} - @media (min-width: 991px) { div.input-hint { margin-top: 30px; @@ -99,10 +82,3 @@ body:not(.fullscreen) :not(.no-frame).phone-frame::before { top: 0; left: 0; } - -@media (max-width: 767px) { - .message-not-supported { - border: 1px solid #dee2e6; - padding: 20px; - } -} diff --git a/player/vr-360/js/script.js b/player/vr-360/js/script.js index 17264cdc..f7250449 100644 --- a/player/vr-360/js/script.js +++ b/player/vr-360/js/script.js @@ -1,55 +1,29 @@ -function isIOS() { - return /iPad|iPhone|iPod/.test(navigator.platform); +var conf = { + key: '29ba4a30-8b5e-4336-a7dd-c94ff3b25f30', + analytics: { + key: '45adcf9b-8f7c-4e28-91c5-50ba3d442cd4', + videoId: 'vr-360' + }, + style: { + aspectratio: '2:1' + }, + playback: { + muted: true + } }; -if (isIOS()) { - showNotSupportedMessage(); -} else { - setupPlayer(); -} - -function showNotSupportedMessage() { - var message = 'This demo is not currently available on iOS as we’re working to enhance this VR/360 demo. Please get in touch if you’d like to learn more.'; - - var container = document.getElementById('player-container'); - var player = document.getElementById('player'); - var messageContainer = document.createElement('div'); - - messageContainer.setAttribute('class', 'message-not-supported') - messageContainer.textContent = message +var source = { + dash: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/mpds/105560.mpd', + hls: 'https://bitmovin.com/player-content/playhouse-vr/m3u8s/105560.m3u8', + progressive: 'https://bitmovin.com/player-content/playhouse-vr/progressive.mp4', + poster: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/poster.jpg', + vr: { + startupMode: '2d', + startPosition: 180 + } +}; - container.append(messageContainer); - player.classList.add('is-unsupported'); -} +var playerContainer = document.getElementById('player-container'); +var player = new bitmovin.player.Player(playerContainer, conf); -function setupPlayer() { - var conf = { - key: '29ba4a30-8b5e-4336-a7dd-c94ff3b25f30', - analytics: { - key: '45adcf9b-8f7c-4e28-91c5-50ba3d442cd4', - videoId: 'vr-360' - }, - style: { - aspectratio: '2:1' - }, - playback: { - muted: true - } - }; - - var source = { - dash: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/mpds/105560.mpd', - hls: 'https://bitmovin.com/player-content/playhouse-vr/m3u8s/105560.m3u8', - progressive: 'https://bitmovin.com/player-content/playhouse-vr/progressive.mp4', - poster: 'https://bitmovin-a.akamaihd.net/content/playhouse-vr/poster.jpg', - vr: { - startupMode: '2d', - startPosition: 180 - } - }; - - var playerContainer = document.getElementById('player-container'); - var player = new bitmovin.player.Player(playerContainer, conf); - - player.load(source); -} \ No newline at end of file +player.load(source);