Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>22652123</title>
- <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
- <script>
- var isIE = false;
- $(document).ready(function(){
- checkIE();
- startUp();
- startVid();
- });
- function getInternetExplorerVersion() {
- // Returns the version of Internet Explorer or a -1
- // (indicating the use of another browser).
- var rv = -1; // Return value assumes failure.
- if (navigator.appName == 'Microsoft Internet Explorer') {
- var ua = navigator.userAgent;
- var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
- if (re.exec(ua) != null)
- rv = parseFloat(RegExp.$1);
- }
- else if (navigator.appName == 'Netscape') {
- var ua = navigator.userAgent;
- var re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})");
- if (re.exec(ua) != null)
- rv = parseFloat(RegExp.$1);
- }
- return rv;
- }
- function checkIE(){
- var ver = getInternetExplorerVersion();
- if (ver > -1) {
- console.log("You're using IE");
- isIE = true;
- }else{
- console.log("You're not using IE");
- isIE = false;
- }
- }
- function startVid(){
- if(isIE){
- playVidIE();
- }else{
- playVid();
- }
- }
- function playVid() {
- console.log("Playing video for not IE browser");
- var players = document.getElementsByName("video1");
- var options = new Array("");
- url = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
- var id = players[0].playlist.add(url, null, options);
- players[0].playlist.playItem(id);
- }
- function playVidIE() {
- console.log("playing video for IE");
- var vlc = document.getElementById("vlc");
- var options = new Array(":aspect-ratio=16:10", "--rtsp-tcp");
- //var options=[":ts-csa-ck="+EncryptionkeyValue];
- var urlVideofile = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
- var targetURL = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
- var itemId = vlc.playlist.add(targetURL, "", options);
- var id = vlc.playlist.add(urlVideofile, null, options);
- vlc.playlist.playItem(id);
- }
- function startUp(){
- var player;
- if (isIE) {
- player = "<object type='application/x-vlc-plugin' id='vlc' width='300' height='225' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921'></object>";
- } else {
- player = "<embed type='application/x-vlc-plugin' pluginspage='http://www.videolan.org' id='vlc' name='video1' autostart='yes' toolbar='true' loop='yes' width='400' height='300' target='rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov' />";
- }
- $("#video_holder").html(player);
- }
- </script>
- </head>
- <body>
- <div id="video_holder"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment