Skip to content

Commit

Permalink
Re-enable VR demo on iOS devices
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfbyteHeroes committed Sep 16, 2021
1 parent 5b21047 commit fcfc2de
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 75 deletions.
24 changes: 0 additions & 24 deletions player/vr-360/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
76 changes: 25 additions & 51 deletions player/vr-360/js/script.js
Original file line number Diff line number Diff line change
@@ -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);
}
player.load(source);

0 comments on commit fcfc2de

Please sign in to comment.