ocx_mutiplayer.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. <HTML>
  2. <HEAD>
  3. <TITLE>
  4. EasyPlayer Plugin muti-player Example
  5. </TITLE>
  6. <script type="text/javascript">
  7. function config(obj,i) {
  8. var cache = document.getElementById("cache"+i).value;
  9. var playsound = document.getElementById("playsound"+i).checked ? 1 : 0;
  10. var showtoscale = document.getElementById("showtoscale"+i).value;
  11. var showsatic = document.getElementById("showsatic"+i).checked ? 1 : 0;
  12. obj.Config(cache, playsound, showtoscale, showsatic);
  13. //alert(cache+";"+playsound+";"+showtoscale+";"+showsatic);
  14. }
  15. function startplay(i) {
  16. var url = document.getElementById("url"+i).value;
  17. var rendertype = document.getElementById("rendertype"+i).value;
  18. var name = document.getElementById("name"+i).value;
  19. var password = document.getElementById("password"+i).value;
  20. var harddecode = document.getElementById("harddecode"+i).checked ? 1 : 0;
  21. var rtpovertcp = document.getElementById("rtpovertcp"+i).checked ? 1 : 0;
  22. var startNumber = i;
  23. start(url, rendertype, name, password, harddecode,rtpovertcp,startNumber);
  24. //alert(url+";"+rendertype+";"+name+";"+password);
  25. }
  26. function stopplay(i) {
  27. //alert("Close()!!!!!");
  28. // for (var i = 1; i <= 4; ++i) {
  29. var obj = document.getElementById("obj" + i);
  30. obj.Close();
  31. // }
  32. }
  33. function start(url, rendertype, name, password, harddecode,rtpovertcp,startNumber) {
  34. // for (var i = 1; i <= 4; ++i) {
  35. var obj = document.getElementById("obj" + startNumber);
  36. obj.Start(url, rendertype, name, password, harddecode,rtpovertcp);
  37. config(obj,startNumber);
  38. // }
  39. }
  40. </script>
  41. <style>
  42. body {
  43. background: #f0f0f0;
  44. }
  45. .box {
  46. width: 50%;
  47. float: left;
  48. position: relative;
  49. min-height: 1px;
  50. padding-right: 15px;
  51. padding-left: 15px;
  52. box-sizing: border-box;
  53. padding-bottom: 15px;
  54. padding-top: 15px;
  55. border: 1px solid #ccc;
  56. }
  57. .box:nth-of-type(2) {
  58. border-left: none;
  59. }
  60. .box:nth-of-type(3) {
  61. border-top: none;
  62. }
  63. .box:nth-of-type(4) {
  64. border-top: none;
  65. border-left: none;
  66. }
  67. .option {
  68. text-align: right;
  69. font-size: 14px;
  70. padding-top: 15px;
  71. width: 50%;
  72. float: left;
  73. }
  74. .option input {
  75. width: 50%;
  76. }
  77. input {
  78. font-size: 14px;
  79. color: #555;
  80. background-image: none;
  81. border: 1px solid #ccc;
  82. border-radius: 4px;
  83. margin-top: 15px;
  84. padding: 6px 12px;
  85. }
  86. #urlbox {
  87. width: 100%;
  88. text-align: center;
  89. }
  90. #cachebox {
  91. text-align: left;
  92. }
  93. #passwordbox {
  94. text-align: left;
  95. }
  96. input[type=range] {
  97. border-radius: 10px;
  98. border: none;
  99. margin-top: 0;
  100. }
  101. input[type=range]::-ms-track {
  102. border-radius: 10px;
  103. border-color: transparent;
  104. color: transparent;
  105. }
  106. input[type=range]::-ms-thumb {
  107. border: solid 0.125em rgba(205, 224, 230, 0.5);
  108. height: 10px;
  109. width: 25px;
  110. background: #ffffff;
  111. box-shadow: 0 .125em .125em #3b4547;
  112. }
  113. input[type=range]::-ms-fill-lower {
  114. border-radius: 10px;
  115. background: linear-gradient(to right, #059CFA, white 100%, white);
  116. }
  117. input[type=range]::-ms-fill-upper {
  118. border-radius: 10px;
  119. background: #ffffff;
  120. }
  121. input[type=range]:focus::-ms-fill-lower {
  122. background: linear-gradient(to right, #059CFA, white 100%, white);
  123. }
  124. input[type=range]:focus::-ms-fill-upper {
  125. background: #ffffff;
  126. }
  127. .checks {
  128. /* width: 50%; */
  129. height: 200px;
  130. }
  131. .check {
  132. text-align: left;
  133. width: 20%;
  134. float: left;
  135. }
  136. .buttons {
  137. padding-top: 10px;
  138. position: relative;
  139. height: 35px;
  140. }
  141. button {
  142. color: #333;
  143. background-color: #fff;
  144. border-color: #ccc;
  145. display: inline-block;
  146. padding: 6px 12px;
  147. margin-bottom: 0;
  148. font-size: 12px;
  149. font-weight: 400;
  150. line-height: 1.42857143;
  151. text-align: center;
  152. white-space: nowrap;
  153. vertical-align: middle;
  154. touch-action: manipulation;
  155. cursor: pointer;
  156. user-select: none;
  157. background-image: none;
  158. border: 1px solid #ccc;
  159. border-radius: 4px;
  160. width: 65px;
  161. height: 35px;
  162. position: absolute;
  163. bottom: 0px;
  164. left: 50%;
  165. }
  166. .start {
  167. background: #286090;
  168. color: #fff;
  169. margin-left: -130px;
  170. }
  171. .config {
  172. background: #909399;
  173. color: #fff;
  174. margin-left: -35px
  175. }
  176. .stop {
  177. background: #e6e6e6;
  178. color: #000;
  179. margin-left: 65px;
  180. }
  181. </style>
  182. </HEAD>
  183. <BODY>
  184. <center>
  185. <div class="box">
  186. <OBJECT id="obj1" WIDTH=640px HEIGHT=480px CLASSID="CLSID:1EE1C648-F4A9-42F9-9AA7-2C8E3AF7B7FD">
  187. </OBJECT>
  188. <div class="option" id="urlbox">
  189. RTSP URL:
  190. <input type="text" name="url" id="url1" VALUE="rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov" />
  191. </div>
  192. <div class="options">
  193. <div class="option">
  194. 用户名:
  195. <input type="text" name="name" id="name1" size=25 value="" />
  196. </div>
  197. <div class="option" id="passwordbox">
  198. 密码:
  199. <input type="password" name="password" id="password1" size=25 value="" />
  200. </div>
  201. <div class="option">
  202. RenderFormat:
  203. <input type="range" max="7" min="1" name="showtoscale" id="showtoscale1" size=25 value="7" />
  204. </div>
  205. <div class="option" id="cachebox">
  206. 缓存:
  207. <input type="range" max="10" min="1" name="cache" id="cache1" size=25 value="3" />
  208. </div>
  209. </div>
  210. <div class="checks">
  211. <div class="check">
  212. RTP Over TCP:
  213. <input type="checkbox" name="rtpovertcp" id="rtpovertcp1" size=25 checked="checked" />
  214. </div>
  215. <div class="check">
  216. 按比例显示:
  217. <input type="checkbox" name="rendertype" id="rendertype1" checked="checked" />
  218. </div>
  219. <div class="check">
  220. 采用硬解码
  221. <input type="checkbox" name="harddecode" id="harddecode1" checked="checked" />
  222. </div>
  223. <div class="check">
  224. 播放声音:
  225. <input type="checkbox" name="playsound" id="playsound1" size=25 checked="checked" />
  226. </div>
  227. <div class="check">
  228. 显示码率信息
  229. <input type="checkbox" name="showsatic" id="showsatic1" checked="checked" />
  230. </div>
  231. </div>
  232. <div class="buttons">
  233. <button class="start" type="button" onclick="startplay(1);">Start</button>
  234. <button class="config" type="button" onclick="config();">config</button>
  235. <button class="stop" type="button" onclick="stopplay(1);">Stop</button>
  236. </div>
  237. </div>
  238. <div class="box">
  239. <OBJECT id="obj2" WIDTH=640px HEIGHT=480px CLASSID="CLSID:1EE1C648-F4A9-42F9-9AA7-2C8E3AF7B7FD">
  240. </OBJECT>
  241. <div class="option" id="urlbox">
  242. RTSP URL:
  243. <input type="text" name="url" id="url2" VALUE="rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov" />
  244. </div>
  245. <div class="options">
  246. <div class="option">
  247. 用户名:
  248. <input type="text" name="name" id="name2" size=25 value="" />
  249. </div>
  250. <div class="option" id="passwordbox">
  251. 密码:
  252. <input type="password" name="password" id="password2" size=25 value="" />
  253. </div>
  254. <div class="option">
  255. RenderFormat:
  256. <input type="range" max="7" min="1" name="showtoscale" id="showtoscale2" size=25 value="7" />
  257. </div>
  258. <div class="option" id="cachebox">
  259. 缓存:
  260. <input type="range" max="10" min="1" name="cache" id="cache2" size=25 value="3" />
  261. </div>
  262. </div>
  263. <div class="checks">
  264. <div class="check">
  265. RTP Over TCP:
  266. <input type="checkbox" name="rtpovertcp" id="rtpovertcp2" size=25 checked="checked" />
  267. </div>
  268. <div class="check">
  269. 按比例显示:
  270. <input type="checkbox" name="rendertype" id="rendertype2" checked="checked" />
  271. </div>
  272. <div class="check">
  273. 采用硬解码
  274. <input type="checkbox" name="harddecode" id="harddecode2" checked="checked" />
  275. </div>
  276. <div class="check">
  277. 播放声音:
  278. <input type="checkbox" name="playsound" id="playsound2" size=25 checked="checked" />
  279. </div>
  280. <div class="check">
  281. 显示码率信息
  282. <input type="checkbox" name="showsatic" id="showsatic2" checked="checked" />
  283. </div>
  284. </div>
  285. <div class="buttons">
  286. <button class="start" type="button" onclick="startplay(2);">Start</button>
  287. <button class="config" type="button" onclick="config();">config</button>
  288. <button class="stop" type="button" onclick="stopplay(2);">Stop</button>
  289. </div>
  290. </div>
  291. <div class="box">
  292. <OBJECT id="obj3" WIDTH=640px HEIGHT=480px CLASSID="CLSID:1EE1C648-F4A9-42F9-9AA7-2C8E3AF7B7FD">
  293. </OBJECT>
  294. <div class="option" id="urlbox">
  295. RTSP URL:
  296. <input type="text" name="url" id="url3" VALUE="rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov" />
  297. </div>
  298. <div class="options">
  299. <div class="option">
  300. 用户名:
  301. <input type="text" name="name" id="name3" size=25 value="" />
  302. </div>
  303. <div class="option" id="passwordbox">
  304. 密码:
  305. <input type="password" name="password" id="password3" size=25 value="" />
  306. </div>
  307. <div class="option">
  308. RenderFormat:
  309. <input type="range" max="7" min="1" name="showtoscale" id="showtoscale3" size=25 value="7" />
  310. </div>
  311. <div class="option" id="cachebox">
  312. 缓存:
  313. <input type="range" max="10" min="1" name="cache" id="cache3" size=25 value="3" />
  314. </div>
  315. </div>
  316. <div class="checks">
  317. <div class="check">
  318. RTP Over TCP:
  319. <input type="checkbox" name="rtpovertcp" id="rtpovertcp3" size=25 checked="checked" />
  320. </div>
  321. <div class="check">
  322. 按比例显示:
  323. <input type="checkbox" name="rendertype" id="rendertype3" checked="checked" />
  324. </div>
  325. <div class="check">
  326. 采用硬解码
  327. <input type="checkbox" name="harddecode" id="harddecode3" checked="checked" />
  328. </div>
  329. <div class="check">
  330. 播放声音:
  331. <input type="checkbox" name="playsound" id="playsound3" size=25 checked="checked" />
  332. </div>
  333. <div class="check">
  334. 显示码率信息
  335. <input type="checkbox" name="showsatic" id="showsatic3" checked="checked" />
  336. </div>
  337. </div>
  338. <div class="buttons">
  339. <button class="start" type="button" onclick="startplay(3);">Start</button>
  340. <button class="config" type="button" onclick="config();">config</button>
  341. <button class="stop" type="button" onclick="stopplay(3);">Stop</button>
  342. </div>
  343. </div>
  344. <div class="box">
  345. <OBJECT id="obj4" WIDTH=640px HEIGHT=480px CLASSID="CLSID:1EE1C648-F4A9-42F9-9AA7-2C8E3AF7B7FD">
  346. </OBJECT>
  347. <div class="option" id="urlbox">
  348. RTSP URL:
  349. <input type="text" name="url" id="url4" VALUE="rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov" />
  350. </div>
  351. <div class="options">
  352. <div class="option">
  353. 用户名:
  354. <input type="text" name="name" id="name4" size=25 value="" />
  355. </div>
  356. <div class="option" id="passwordbox">
  357. 密码:
  358. <input type="password" name="password" id="password4" size=25 value="" />
  359. </div>
  360. <div class="option">
  361. RenderFormat:
  362. <input type="range" max="7" min="1" name="showtoscale" id="showtoscale4" size=25 value="7" />
  363. </div>
  364. <div class="option" id="cachebox">
  365. 缓存:
  366. <input type="range" max="10" min="1" name="cache" id="cache" size=25 value="3" />
  367. </div>
  368. </div>
  369. <div class="checks">
  370. <div class="check">
  371. RTP Over TCP:
  372. <input type="checkbox" name="rtpovertcp" id="rtpovertcp4" size=25 checked="checked" />
  373. </div>
  374. <div class="check">
  375. 按比例显示:
  376. <input type="checkbox" name="rendertype" id="rendertype4" checked="checked" />
  377. </div>
  378. <div class="check">
  379. 采用硬解码
  380. <input type="checkbox" name="harddecode" id="harddecode4" checked="checked" />
  381. </div>
  382. <div class="check">
  383. 播放声音:
  384. <input type="checkbox" name="playsound" id="playsound4" size=25 checked="checked" />
  385. </div>
  386. <div class="check">
  387. 显示码率信息
  388. <input type="checkbox" name="showsatic" id="showsatic4" checked="checked" />
  389. </div>
  390. </div>
  391. <div class="buttons">
  392. <button class="start" type="button" onclick="startplay(4);">Start</button>
  393. <button class="config" type="button" onclick="config();">config</button>
  394. <button class="stop" type="button" onclick="stopplay(4);">Stop</button>
  395. </div>
  396. </div>
  397. <!-- 界面信息<br>
  398. RTSP URL:<input type="text" name="url" id="url" VALUE="rtsp://127.0.0.1:10554/stream.sdp"/>
  399. RenderFormat:<input type="text" name="rendertype" id="rendertype" VALUE="0"/>
  400. 采用硬解码:<input type="text" name="harddecode" id="harddecode" size=25 value="0"/>
  401. <br>
  402. 缓存:<input type="text" name="cache" id="cache" size=25 value ="3"/>
  403. 播放声音:<input type="text" name="playsound" id="playsound" size=25 value ="0"/>
  404. 按比例显示:<input type="text" name="showtoscale" id="showtoscale" size=25 value ="1"/>
  405. 显示码率信息:<input type="text" name="showsatic" id="showsatic" size=25 value ="1"/><br> -->
  406. <!-- <button type="button" onclick="startplay();">Start</button>
  407. <button type="button" onclick="config();">config</button>
  408. <button type="button" onclick="stopplay();">Stop</button> -->
  409. </center>
  410. </BODY>
  411. </HTML>