2
0

jwplayer6.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>SRS</title>
  5. <meta charset="utf-8">
  6. <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
  7. <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
  8. <script type="text/javascript" src="js/bootstrap.min.js"></script>
  9. <script type="text/javascript" src="js/srs.page.js"></script>
  10. <script type="text/javascript" src="js/srs.log.js"></script>
  11. <script type="text/javascript" src="js/srs.player.js"></script>
  12. <script type="text/javascript" src="js/srs.publisher.js"></script>
  13. <script type="text/javascript" src="js/srs.utility.js"></script>
  14. <script type="text/javascript" src="js/winlin.utility.js"></script>
  15. <style>
  16. body{
  17. padding-top: 55px;
  18. }
  19. #main_modal {
  20. width: 700px;
  21. margin-left: -350px;
  22. }
  23. </style>
  24. <script type="text/javascript" src="js/jwplayer.js" ></script>
  25. <script type='text/javascript'>jwplayer.key = 'N8zhkmYvvRwOhz4aTGkySoEri4x+9pQwR7GHIQ=='; </script>
  26. <script type="text/javascript">
  27. var _player = null;
  28. var _url = null;
  29. $(function(){
  30. // get the vhost and port to set the default url.
  31. // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo
  32. // url set to: rtmp://demo:1935/live/livestream
  33. srs_init("#txt_rtmp_url", "#txt_hls_url", "#main_modal");
  34. $("#main_modal").on("hide", function(){
  35. $("#div_container").remove();
  36. _player.stop();
  37. });
  38. $("#main_modal").on("show", function(){
  39. $("#div_container").remove();
  40. var div_container = $("<div/>");
  41. $(div_container).attr("id", "div_container");
  42. $("#player").append(div_container);
  43. var player = $("<div/>");
  44. $(player).attr("id", "player_id");
  45. $(div_container).append(player);
  46. var conf = {
  47. file: _url,
  48. width: srs_get_player_width(),
  49. height: srs_get_player_height(),
  50. autostart: true,
  51. analytics: { enabled: false}
  52. };
  53. _player = jwplayer('player_id').setup(conf);
  54. });
  55. $("#btn_play_rtmp").click(function(){
  56. _url = $("#txt_rtmp_url").val();
  57. $("#main_modal").modal({show:true, keyboard:false});
  58. });
  59. $("#btn_play_hls").click(function(){
  60. _url = $("#txt_hls_url").val();
  61. $("#main_modal").modal({show:true, keyboard:false});
  62. });
  63. var query = parse_query_string();
  64. if (query.hls_autostart == "true") {
  65. _url = $("#txt_hls_url").val();
  66. $("#main_modal").modal({show:true, keyboard:false});
  67. } else if (query.rtmp_autostart == "true") {
  68. _url = $("#txt_rtmp_url").val();
  69. $("#main_modal").modal({show:true, keyboard:false});
  70. }
  71. });
  72. </script>
  73. </head>
  74. <body>
  75. <div class="navbar navbar-fixed-top">
  76. <div class="navbar-inner">
  77. <div class="container">
  78. <a id="srs_index" class="brand" href="#">SRS</a>
  79. <div class="nav-collapse collapse">
  80. <ul class="nav">
  81. <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li>
  82. <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li>
  83. <li><a id="nav_srs_chat" href="srs_chat.html">SRS会议</a></li>
  84. <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li>
  85. <li class="active"><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li>
  86. <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li>
  87. <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li>
  88. </ul>
  89. </div>
  90. </div>
  91. </div>
  92. </div>
  93. <div class="container">
  94. <div class="alert alert-info fade in">
  95. <button type="button" class="close" data-dismiss="alert">×</button>
  96. <strong><span>Usage:</span></strong> <span>输入地址后点击播放按钮</span>
  97. </div>
  98. <div class="form-inline">
  99. URL:
  100. <input type="text" id="txt_rtmp_url" class="input-xxlarge" value=""></input>
  101. <button class="btn btn-primary" id="btn_play_rtmp">播放RTMP</button>
  102. </div>
  103. <hr/>
  104. <div class="form-inline">
  105. URL:
  106. <input type="text" id="txt_hls_url" class="input-xxlarge" value=""></input>
  107. <button class="btn btn-primary" id="btn_play_hls"> 播放HLS </button>
  108. </div>
  109. <div id="main_modal" class="modal hide fade">
  110. <div class="modal-header">
  111. <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  112. <h3>JWPlayer6</h3>
  113. </div>
  114. <div class="modal-body" id="player">
  115. </div>
  116. <div class="modal-footer">
  117. <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"> 关闭 </button>
  118. </div>
  119. </div>
  120. <hr>
  121. <footer>
  122. <p><a href="https://github.com/ossrs/srs">SRS Team &copy; 2013</a></p>
  123. </footer>
  124. </div>
  125. </body>