Skip to content

Instantly share code, notes, and snippets.

@kuu
Last active April 4, 2016 06:14
Show Gist options
  • Save kuu/e6c0686949e56b5e0226defde5f3f5a6 to your computer and use it in GitHub Desktop.
Save kuu/e6c0686949e56b5e0226defde5f3f5a6 to your computer and use it in GitHub Desktop.
Sample code for the flash player detection.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
<script src="ua-parser.min.js"></script>
<script src="swfobject.js"></script>
<script src="//player.ooyala.com/v3/{YOUR-PLAYER-ID}"></script>
</head>
<body>
<div id="ooyalaplayer" style="width:640px;height:360px"></div>
<script>
var browser = (new UAParser()).getResult().browser;
if ((browser.name === 'IE' || browser.name === 'Firefox') && (swfobject.hasFlashPlayerVersion('10.0.0') === false)) {
var div = document.querySelector('#ooyalaplayer');
div.innerHTML = '<a href="https://get.adobe.com/flashplayer/">Please install flash.</a>';
} else {
OO.ready(function() {
OO.Player.create('ooyalaplayer', 'YOUR-EMBED-CODE');
});
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment