-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from bitmovin/feature/re-enable-ios-vr-demo
Re-enable VR demo on iOS devices
- Loading branch information
Showing
2 changed files
with
25 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |