Last active
April 4, 2016 06:14
-
-
Save kuu/e6c0686949e56b5e0226defde5f3f5a6 to your computer and use it in GitHub Desktop.
Sample code for the flash player detection.
This file contains hidden or 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
<!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