Guest User

22652123-2

a guest
Mar 26th, 2014
420
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>22652123</title>
  5. <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
  6. <script>
  7. var isIE = false;
  8.  
  9. $(document).ready(function(){
  10. checkIE();
  11. startUp();
  12. startVid();
  13. });
  14.  
  15. function getInternetExplorerVersion() {
  16. // Returns the version of Internet Explorer or a -1
  17. // (indicating the use of another browser).
  18.  
  19. var rv = -1; // Return value assumes failure.
  20. if (navigator.appName == 'Microsoft Internet Explorer') {
  21. var ua = navigator.userAgent;
  22. var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  23. if (re.exec(ua) != null)
  24. rv = parseFloat(RegExp.$1);
  25. }
  26. else if (navigator.appName == 'Netscape') {
  27. var ua = navigator.userAgent;
  28. var re = new RegExp("Trident/.*rv:([0-9]{1,}[\.0-9]{0,})");
  29. if (re.exec(ua) != null)
  30. rv = parseFloat(RegExp.$1);
  31. }
  32. return rv;
  33. }
  34.  
  35. function checkIE(){
  36. var ver = getInternetExplorerVersion();
  37. if (ver > -1) {
  38. console.log("You're using IE");
  39. isIE = true;
  40. }else{
  41. console.log("You're not using IE");
  42. isIE = false;
  43. }
  44. }
  45.  
  46. function startVid(){
  47. if(isIE){
  48. playVidIE();
  49. }else{
  50. playVid();
  51. }
  52. }
  53.  
  54. function playVid() {
  55. console.log("Playing video for not IE browser");
  56. var players = document.getElementsByName("video1");
  57. var options = new Array("");
  58. url = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
  59. var id = players[0].playlist.add(url, null, options);
  60. players[0].playlist.playItem(id);
  61. }
  62.  
  63. function playVidIE() {
  64. console.log("playing video for IE");
  65. var vlc = document.getElementById("vlc");
  66. var options = new Array(":aspect-ratio=16:10", "--rtsp-tcp");
  67. //var options=[":ts-csa-ck="+EncryptionkeyValue];
  68. var urlVideofile = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
  69. var targetURL = "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
  70. var itemId = vlc.playlist.add(targetURL, "", options);
  71. var id = vlc.playlist.add(urlVideofile, null, options);
  72. vlc.playlist.playItem(id);
  73. }
  74.  
  75. function startUp(){
  76. var player;
  77. if (isIE) {
  78. player = "<object type='application/x-vlc-plugin' id='vlc' width='300' height='225' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921'></object>";
  79. } else {
  80. 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' />";
  81. }
  82. $("#video_holder").html(player);
  83. }
  84. </script>
  85. </head>
  86. <body>
  87. <div id="video_holder"></div>
  88. </body>
  89. </html>
Advertisement
Add Comment
Please, Sign In to add comment