正在显示
47 个修改的文件
包含
3077 行增加
和
1172 行删除
| @@ -43,13 +43,13 @@ python ./research/api-server/server.py 8085 | @@ -43,13 +43,13 @@ python ./research/api-server/server.py 8085 | ||
| 43 | </pre> | 43 | </pre> |
| 44 | <strong>step 6:</strong> publish live stream <br/> | 44 | <strong>step 6:</strong> publish live stream <br/> |
| 45 | <pre> | 45 | <pre> |
| 46 | -FMS URL: rtmp://127.0.0.1:1935/live | 46 | +FMS URL: rtmp://127.0.0.1/live |
| 47 | Stream: livestream | 47 | Stream: livestream |
| 48 | For example, use ffmpeg to publish: | 48 | For example, use ffmpeg to publish: |
| 49 | for((;;)); do \ | 49 | for((;;)); do \ |
| 50 | ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \ | 50 | ./objs/ffmpeg/bin/ffmpeg -re -i ./doc/source.200kbps.768x320.flv \ |
| 51 | -vcodec copy -acodec copy \ | 51 | -vcodec copy -acodec copy \ |
| 52 | - -f flv -y rtmp://127.0.0.1:1935/live/livestream; \ | 52 | + -f flv -y rtmp://127.0.0.1/live?vhost=demo.srs.com/livestream; \ |
| 53 | sleep 1; \ | 53 | sleep 1; \ |
| 54 | done | 54 | done |
| 55 | </pre> | 55 | </pre> |
| @@ -59,35 +59,35 @@ For example, use ffmpeg to publish: | @@ -59,35 +59,35 @@ For example, use ffmpeg to publish: | ||
| 59 | # linux: /etc/hosts | 59 | # linux: /etc/hosts |
| 60 | # windows: C:\Windows\System32\drivers\etc\hosts | 60 | # windows: C:\Windows\System32\drivers\etc\hosts |
| 61 | # where server ip is 192.168.2.111 | 61 | # where server ip is 192.168.2.111 |
| 62 | -192.168.2.111 demo | 62 | +192.168.2.111 demo.srs.com |
| 63 | </pre> | 63 | </pre> |
| 64 | <strong>step 8:</strong> play live stream. <br/> | 64 | <strong>step 8:</strong> play live stream. <br/> |
| 65 | <pre> | 65 | <pre> |
| 66 | -players: http://demo:80/players | ||
| 67 | -rtmp url: rtmp://demo:1935/live/livestream | ||
| 68 | -m3u8 url: http://demo:80/live/livestream.m3u8 | ||
| 69 | -for android: http://demo:80/live/livestream.html | 66 | +players: [http://demo.srs.com/players](http://demo.srs.com/players) |
| 67 | +rtmp url: rtmp://demo.srs.com/live/livestream | ||
| 68 | +m3u8 url: http://demo.srs.com/live/livestream.m3u8 | ||
| 69 | +for android: http://demo.srs.com/live/livestream.html | ||
| 70 | </pre> | 70 | </pre> |
| 71 | <strong>step 9(optinal):</strong> play live stream auto transcoded<br/> | 71 | <strong>step 9(optinal):</strong> play live stream auto transcoded<br/> |
| 72 | <pre> | 72 | <pre> |
| 73 | -rtmp url: rtmp://demo:1935/live/livestream_ld | ||
| 74 | -m3u8 url: http://demo:80/live/livestream_ld.m3u8 | ||
| 75 | -for android: http://demo:80/live/livestream_ld.html | ||
| 76 | -rtmp url: rtmp://demo:1935/live/livestream_sd | ||
| 77 | -m3u8 url: http://demo:80/live/livestream_sd.m3u8 | ||
| 78 | -for android: http://demo:80/live/livestream_sd.html | 73 | +rtmp url: rtmp://demo.srs.com/live/livestream_ld |
| 74 | +m3u8 url: http://demo.srs.com/live/livestream_ld.m3u8 | ||
| 75 | +for android: [http://demo.srs.com/live/livestream_ld.html](http://demo.srs.com/live/livestream_ld.html) | ||
| 76 | +rtmp url: rtmp://demo.srs.com/live/livestream_sd | ||
| 77 | +m3u8 url: http://demo.srs.com/live/livestream_sd.m3u8 | ||
| 78 | +for android: [http://demo.srs.com/live/livestream_sd.html](http://demo.srs.com/live/livestream_sd.html) | ||
| 79 | </pre> | 79 | </pre> |
| 80 | <strong>step 10(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/> | 80 | <strong>step 10(optinal):</strong> play live stream auto forwarded, the hls dir change to /forward<br/> |
| 81 | <pre> | 81 | <pre> |
| 82 | -rtmp url: rtmp://demo:19350/live/livestream | ||
| 83 | -m3u8 url: http://demo:80/forward/live/livestream.m3u8 | ||
| 84 | -for android: http://demo:80/forward/live/livestream.html | ||
| 85 | -rtmp url: rtmp://demo:19350/live/livestream_ld | ||
| 86 | -m3u8 url: http://demo:80/forward/live/livestream_ld.m3u8 | ||
| 87 | -for android: http://demo:80/forward/live/livestream_ld.html | ||
| 88 | -rtmp url: rtmp://demo:19350/live/livestream_sd | ||
| 89 | -m3u8 url: http://demo:80/forward/live/livestream_sd.m3u8 | ||
| 90 | -for android: http://demo:80/forward/live/livestream_sd.html | 82 | +rtmp url: rtmp://demo.srs.com:19350/live/livestream |
| 83 | +m3u8 url: http://demo.srs.com/forward/live/livestream.m3u8 | ||
| 84 | +for android: [http://demo.srs.com/forward/live/livestream.html](http://demo.srs.com/forward/live/livestream.html) | ||
| 85 | +rtmp url: rtmp://demo.srs.com:19350/live/livestream_ld | ||
| 86 | +m3u8 url: http://demo.srs.com/forward/live/livestream_ld.m3u8 | ||
| 87 | +for android: [http://demo.srs.com/forward/live/livestream_ld.html](http://demo.srs.com/forward/live/livestream_ld.html) | ||
| 88 | +rtmp url: rtmp://demo.srs.com:19350/live/livestream_sd | ||
| 89 | +m3u8 url: http://demo.srs.com/forward/live/livestream_sd.m3u8 | ||
| 90 | +for android: [http://demo.srs.com/forward/live/livestream_sd.html](http://demo.srs.com/forward/live/livestream_sd.html) | ||
| 91 | </pre> | 91 | </pre> |
| 92 | <strong>step 11(optinal):</strong> modify the config and reload it (all features support reload)<br/> | 92 | <strong>step 11(optinal):</strong> modify the config and reload it (all features support reload)<br/> |
| 93 | <pre> | 93 | <pre> |
| @@ -243,7 +243,8 @@ if [ $SRS_HLS = YES ]; then | @@ -243,7 +243,8 @@ if [ $SRS_HLS = YES ]; then | ||
| 243 | sed -i "s/^.user nobody;/user `whoami`;/g" ${SRS_OBJS}/nginx/conf/nginx.conf | 243 | sed -i "s/^.user nobody;/user `whoami`;/g" ${SRS_OBJS}/nginx/conf/nginx.conf |
| 244 | 244 | ||
| 245 | # create forward dir | 245 | # create forward dir |
| 246 | - mkdir -p ${SRS_OBJS}/nginx/html/forward | 246 | + mkdir -p ${SRS_OBJS}/nginx/html/live && |
| 247 | + mkdir -p ${SRS_OBJS}/nginx/html/forward/live | ||
| 247 | 248 | ||
| 248 | # generate default html pages for android. | 249 | # generate default html pages for android. |
| 249 | html_file=${SRS_OBJS}/nginx/html/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5 | 250 | html_file=${SRS_OBJS}/nginx/html/live/livestream.html && hls_stream=livestream.m3u8 && write_nginx_html5 |
| @@ -254,7 +255,17 @@ if [ $SRS_HLS = YES ]; then | @@ -254,7 +255,17 @@ if [ $SRS_HLS = YES ]; then | ||
| 254 | html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5 | 255 | html_file=${SRS_OBJS}/nginx/html/forward/live/livestream_sd.html && hls_stream=livestream_sd.m3u8 && write_nginx_html5 |
| 255 | 256 | ||
| 256 | # copy players to nginx html dir. | 257 | # copy players to nginx html dir. |
| 257 | - cp research/players ${SRS_OBJS}/nginx/html/ -r | 258 | + rm -rf ${SRS_OBJS}/nginx/html/players && |
| 259 | + ln -sf `pwd`/research/players ${SRS_OBJS}/nginx/html/players && | ||
| 260 | + rm -f ${SRS_OBJS}/nginx/crossdomain.xml && | ||
| 261 | + ln -sf `pwd`/research/players/crossdomain.xml ${SRS_OBJS}/nginx/html/crossdomain.xml | ||
| 262 | + | ||
| 263 | + # override the default index. | ||
| 264 | + cat <<END > ${SRS_OBJS}/nginx/html/index.html | ||
| 265 | + <script type="text/javascript"> | ||
| 266 | + window.location.href = "players/index.html"; | ||
| 267 | + </script> | ||
| 268 | +END | ||
| 258 | fi | 269 | fi |
| 259 | 270 | ||
| 260 | if [ $SRS_HLS = YES ]; then | 271 | if [ $SRS_HLS = YES ]; then |
| @@ -327,8 +338,10 @@ fi | @@ -327,8 +338,10 @@ fi | ||
| 327 | ##################################################################################### | 338 | ##################################################################################### |
| 328 | # build research code | 339 | # build research code |
| 329 | ##################################################################################### | 340 | ##################################################################################### |
| 330 | -(cd research/hls && make) | 341 | +mkdir -p ${SRS_OBJS}/research |
| 342 | + | ||
| 343 | +(cd research/hls && make && mv ts_info ../../${SRS_OBJS}/research) | ||
| 331 | ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi | 344 | ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/hls failed, ret=$ret"; exit $ret; fi |
| 332 | 345 | ||
| 333 | -(cd research/ffempty && make) | 346 | +(cd research/ffempty && make && mv ffempty ../../${SRS_OBJS}/research) |
| 334 | ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi | 347 | ret=$?; if [[ $ret -ne 0 ]]; then echo "build research/ffempty failed, ret=$ret"; exit $ret; fi |
| @@ -3,9 +3,11 @@ vhost __defaultVhost__ { | @@ -3,9 +3,11 @@ vhost __defaultVhost__ { | ||
| 3 | chunk_size 65000; | 3 | chunk_size 65000; |
| 4 | enabled on; | 4 | enabled on; |
| 5 | gop_cache on; | 5 | gop_cache on; |
| 6 | - hls on; | 6 | + hls { |
| 7 | + enabled on; | ||
| 7 | hls_path ./objs/nginx/html/forward; | 8 | hls_path ./objs/nginx/html/forward; |
| 8 | hls_fragment 5; | 9 | hls_fragment 5; |
| 9 | hls_window 30; | 10 | hls_window 30; |
| 11 | + } | ||
| 10 | } | 12 | } |
| 11 | 13 |
| @@ -18,11 +18,18 @@ chunk_size 65000; | @@ -18,11 +18,18 @@ chunk_size 65000; | ||
| 18 | # vhost list, the __defaultVhost__ is the default vhost | 18 | # vhost list, the __defaultVhost__ is the default vhost |
| 19 | # for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream. | 19 | # for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream. |
| 20 | # for which cannot identify the required vhost. | 20 | # for which cannot identify the required vhost. |
| 21 | -# for default demo. | ||
| 22 | vhost __defaultVhost__ { | 21 | vhost __defaultVhost__ { |
| 23 | chunk_size 65000; | 22 | chunk_size 65000; |
| 24 | enabled on; | 23 | enabled on; |
| 25 | gop_cache on; | 24 | gop_cache on; |
| 25 | +} | ||
| 26 | +# vhost list, the __defaultVhost__ is the default vhost | ||
| 27 | +# for example, user use ip to access the stream: rtmp://192.168.1.2/live/livestream. | ||
| 28 | +# for which cannot identify the required vhost. | ||
| 29 | +# for default demo. | ||
| 30 | +vhost demo.srs.com { | ||
| 31 | + enabled on; | ||
| 32 | + gop_cache on; | ||
| 26 | queue_length 30; | 33 | queue_length 30; |
| 27 | forward 127.0.0.1:19350; | 34 | forward 127.0.0.1:19350; |
| 28 | hls { | 35 | hls { |
| @@ -32,7 +39,7 @@ vhost __defaultVhost__ { | @@ -32,7 +39,7 @@ vhost __defaultVhost__ { | ||
| 32 | hls_window 30; | 39 | hls_window 30; |
| 33 | } | 40 | } |
| 34 | http_hooks { | 41 | http_hooks { |
| 35 | - enabled off; | 42 | + enabled on; |
| 36 | on_connect http://127.0.0.1:8085/api/v1/clients; | 43 | on_connect http://127.0.0.1:8085/api/v1/clients; |
| 37 | on_close http://127.0.0.1:8085/api/v1/clients; | 44 | on_close http://127.0.0.1:8085/api/v1/clients; |
| 38 | on_publish http://127.0.0.1:8085/api/v1/streams; | 45 | on_publish http://127.0.0.1:8085/api/v1/streams; |
| @@ -46,7 +53,7 @@ vhost __defaultVhost__ { | @@ -46,7 +53,7 @@ vhost __defaultVhost__ { | ||
| 46 | engine ld { | 53 | engine ld { |
| 47 | enabled on; | 54 | enabled on; |
| 48 | vfilter { | 55 | vfilter { |
| 49 | - vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; | 56 | + vf 'drawtext=text=SimpleRtmpServer(SRS):x=10:y=10:fontsize=30:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; |
| 50 | } | 57 | } |
| 51 | vcodec libx264; | 58 | vcodec libx264; |
| 52 | vbitrate 300; | 59 | vbitrate 300; |
| @@ -91,15 +98,57 @@ vhost __defaultVhost__ { | @@ -91,15 +98,57 @@ vhost __defaultVhost__ { | ||
| 91 | } | 98 | } |
| 92 | } | 99 | } |
| 93 | } | 100 | } |
| 101 | +# for the players site, to play or publish. | ||
| 102 | +# the flash player publisher need to transcode to support hls, | ||
| 103 | +# we add players_hls vhost to support it. | ||
| 104 | +vhost players { | ||
| 105 | + enabled on; | ||
| 106 | + gop_cache on; | ||
| 107 | + transcode { | ||
| 108 | + enabled on; | ||
| 109 | + ffmpeg ./objs/ffmpeg/bin/ffmpeg; | ||
| 110 | + engine hls { | ||
| 111 | + enabled on; | ||
| 112 | + vfilter { | ||
| 113 | + vf 'drawtext=text=SRS(SimpleRtmpServer):x=10:y=10:fontcolor=#cccccc:fontfile=./doc/FreeSerifBold.ttf'; | ||
| 114 | + } | ||
| 115 | + vcodec libx264; | ||
| 116 | + vbitrate 300; | ||
| 117 | + vfps 20; | ||
| 118 | + vwidth 768; | ||
| 119 | + vheight 320; | ||
| 120 | + vthreads 1; | ||
| 121 | + vprofile baseline; | ||
| 122 | + vpreset superfast; | ||
| 123 | + vparams { | ||
| 124 | + } | ||
| 125 | + acodec libaacplus; | ||
| 126 | + abitrate 30; | ||
| 127 | + asample_rate 44100; | ||
| 128 | + achannels 2; | ||
| 129 | + aparams { | ||
| 130 | + } | ||
| 131 | + output rtmp://127.0.0.1:[port]/[app]?vhost=players_pub/[stream]; | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | +} | ||
| 135 | +vhost players_pub { | ||
| 136 | + hls { | ||
| 137 | + enabled on; | ||
| 138 | + hls_path ./objs/nginx/html; | ||
| 139 | + hls_fragment 5; | ||
| 140 | + hls_window 30; | ||
| 141 | + } | ||
| 142 | +} | ||
| 94 | # for development | 143 | # for development |
| 95 | vhost dev { | 144 | vhost dev { |
| 96 | chunk_size 65000; | 145 | chunk_size 65000; |
| 97 | enabled on; | 146 | enabled on; |
| 98 | gop_cache on; | 147 | gop_cache on; |
| 99 | queue_length 10; | 148 | queue_length 10; |
| 100 | - forward 127.0.0.1:19350; | 149 | + #forward 127.0.0.1:19350; |
| 101 | hls { | 150 | hls { |
| 102 | - enabled on; | 151 | + enabled off; |
| 103 | hls_path ./objs/nginx/html; | 152 | hls_path ./objs/nginx/html; |
| 104 | hls_fragment 5; | 153 | hls_fragment 5; |
| 105 | hls_window 30; | 154 | hls_window 30; |
| @@ -587,7 +636,7 @@ vhost all.transcode.vhost.com { | @@ -587,7 +636,7 @@ vhost all.transcode.vhost.com { | ||
| 587 | vhost ffempty.transcode.vhost.com { | 636 | vhost ffempty.transcode.vhost.com { |
| 588 | transcode { | 637 | transcode { |
| 589 | enabled on; | 638 | enabled on; |
| 590 | - ffmpeg ./research/ffempty/ffempty; | 639 | + ffmpeg ./objs/research/ffempty; |
| 591 | engine empty { | 640 | engine empty { |
| 592 | enabled on; | 641 | enabled on; |
| 593 | vcodec libx264; | 642 | vcodec libx264; |
trunk/research/players/crossdomain.xml
0 → 100644
trunk/research/players/css/bootstrap.min.css
0 → 100755
此 diff 太大无法显示。
trunk/research/players/img/tooltip.png
0 → 100644
783 字节
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html> | ||
| 1 | <head> | 3 | <head> |
| 2 | - <title>Players</title> | ||
| 3 | - <meta http-equiv=Content-Type content="text/html;charset=utf-8"> | 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + </style> | ||
| 16 | + <script type="text/javascript"> | ||
| 17 | + $(function(){ | ||
| 18 | + update_nav(); | ||
| 19 | + | ||
| 20 | + // direct to the default vhost for players. | ||
| 21 | + window.location.href = "srs_player.html?vhost=" + srs_get_player_vhost(); | ||
| 22 | + }); | ||
| 23 | + </script> | ||
| 4 | </head> | 24 | </head> |
| 5 | <body> | 25 | <body> |
| 6 | - welcome!</p> | ||
| 7 | - <hr/> | ||
| 8 | - <p><a href="rtmp/index.html">Rtmp流播放器</a></p> | ||
| 9 | - <p><a href="osmf/index.html">OSMF播放器</a></p> | ||
| 10 | - <p><a href="jwplayer5/index.html">JWPlayer5</a></p> | ||
| 11 | - <p><a href="jwplayer6/index.html">JWPlayer6</a></p> | ||
| 12 | - <p><a href="http://www.videolan.org/vlc/">VLC for HLS/rtmp/rtsp/http....</a></p> | 26 | +<div class="navbar navbar-fixed-top"> |
| 27 | + <div class="navbar-inner"> | ||
| 28 | + <div class="container"> | ||
| 29 | + <a class="brand" href="index.html">SRS</a> | ||
| 30 | + <div class="nav-collapse collapse"> | ||
| 31 | + <ul class="nav"> | ||
| 32 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 33 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 34 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 35 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 36 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 37 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 38 | + </ul> | ||
| 39 | + </div> | ||
| 40 | + </div> | ||
| 41 | + </div> | ||
| 42 | +</div> | ||
| 43 | +<div class="container"> | ||
| 44 | + <hr> | ||
| 45 | + <footer> | ||
| 46 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 47 | + </footer> | ||
| 48 | +</div> | ||
| 13 | </body> | 49 | </body> |
| 50 | + |
trunk/research/players/osmf/AdobeFlashPlayerInstall.swf
→
trunk/research/players/js/AdobeFlashPlayerInstall.swf
100644 → 100755
不能预览此文件类型
trunk/research/players/js/bootstrap.min.js
0 → 100755
| 1 | +/*! | ||
| 2 | +* Bootstrap.js by @fat & @mdo | ||
| 3 | +* Copyright 2013 Twitter, Inc. | ||
| 4 | +* http://www.apache.org/licenses/LICENSE-2.0.txt | ||
| 5 | +*/ | ||
| 6 | +!function(e){"use strict";e(function(){e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()};var r=e.fn.alert;e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e.fn.alert.noConflict=function(){return e.fn.alert=r,this},e(document).on("click.alert.data-api",t,n.prototype.close)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")};var n=e.fn.button;e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e.fn.button.noConflict=function(){return e.fn.button=n,this},e(document).on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=n,this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},getActiveIndex:function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},to:function(t){var n=this.getActiveIndex(),r=this;if(t>this.$items.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){r.to(t)}):n==t?this.pause().cycle():this.slide(t>n?"next":"prev",e(this.$items[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle(!0)),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f;this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u](),f=e.Event("slide",{relatedTarget:i[0],direction:o});if(i.hasClass("active"))return;this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var t=e(a.$indicators.children()[a.getActiveIndex()]);t&&t.addClass("active")}));if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}};var n=e.fn.carousel;e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.pause().cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e.fn.carousel.noConflict=function(){return e.fn.carousel=n,this},e(document).on("click.carousel.data-api","[data-slide], [data-slide-to]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=e.extend({},i.data(),n.data()),o;i.carousel(s),(o=n.attr("data-slide-to"))&&i.data("carousel").pause().to(o).cycle(),t.preventDefault()})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning||this.$element.hasClass("in"))return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning||!this.$element.hasClass("in"))return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var n=e.fn.collapse;e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=e.extend({},e.fn.collapse.defaults,r.data(),typeof n=="object"&&n);i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e.fn.collapse.noConflict=function(){return e.fn.collapse=n,this},e(document).on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})}(window.jQuery),!function(e){"use strict";function r(){e(".dropdown-backdrop").remove(),e(t).each(function(){i(e(this)).removeClass("open")})}function i(t){var n=t.attr("data-target"),r;n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=n&&e(n);if(!r||!r.length)r=t.parent();return r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||("ontouchstart"in document.documentElement&&e('<div class="dropdown-backdrop"/>').insertBefore(e(this)).on("click",r),s.toggleClass("open")),n.focus(),!1},keydown:function(n){var r,s,o,u,a,f;if(!/(38|40|27)/.test(n.keyCode))return;r=e(this),n.preventDefault(),n.stopPropagation();if(r.is(".disabled, :disabled"))return;u=i(r),a=u.hasClass("open");if(!a||a&&n.keyCode==27)return n.which==27&&u.find(t).focus(),r.click();s=e("[role=menu] li:not(.divider):visible a",u);if(!s.length)return;f=s.index(s.filter(":focus")),n.keyCode==38&&f>0&&f--,n.keyCode==40&&f<s.length-1&&f++,~f||(f=0),s.eq(f).focus()}};var s=e.fn.dropdown;e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e.fn.dropdown.noConflict=function(){return e.fn.dropdown=s,this},e(document).on("click.dropdown.data-api",r).on("click.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.focus().trigger("shown")}):t.$element.focus().trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(){var e=this;this.$element.hide(),this.backdrop(function(){e.removeBackdrop(),e.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?e.proxy(this.$element[0].focus,this.$element[0]):e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!t)return;i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,t):t()):t&&t()}};var n=e.fn.modal;e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e.fn.modal.noConflict=function(){return e.fn.modal=n,this},e(document).on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s,o,u,a;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,o=this.options.trigger.split(" ");for(a=o.length;a--;)u=o[a],u=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):u!="manual"&&(i=u=="hover"?"mouseenter":"focus",s=u=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this)));this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e.fn[this.type].defaults,r={},i;this._options&&e.each(this._options,function(e,t){n[e]!=t&&(r[e]=t)},this),i=e(t.currentTarget)[this.type](r).data(this.type);if(!i.options.delay||!i.options.delay.show)return i.show();clearTimeout(this.timeout),i.hoverState="in",this.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var t,n,r,i,s,o,u=e.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(u);if(u.isDefaultPrevented())return;t=this.tip(),this.setContent(),this.options.animation&&t.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,t[0],this.$element[0]):this.options.placement,t.detach().css({top:0,left:0,display:"block"}),this.options.container?t.appendTo(this.options.container):t.insertAfter(this.$element),n=this.getPosition(),r=t[0].offsetWidth,i=t[0].offsetHeight;switch(s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}this.applyPlacement(o,s),this.$element.trigger("shown")}},applyPlacement:function(e,t){var n=this.tip(),r=n[0].offsetWidth,i=n[0].offsetHeight,s,o,u,a;n.offset(e).addClass(t).addClass("in"),s=n[0].offsetWidth,o=n[0].offsetHeight,t=="top"&&o!=i&&(e.top=e.top+i-o,a=!0),t=="bottom"||t=="top"?(u=0,e.left<0&&(u=e.left*-2,e.left=0,n.offset(e),s=n[0].offsetWidth,o=n[0].offsetHeight),this.replaceArrow(u-r+s,s,"left")):this.replaceArrow(o-i,o,"top"),a&&n.offset(e)},replaceArrow:function(e,t,n){this.arrow().css(n,e?50*(1-e/t)+"%":"")},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function i(){var t=setTimeout(function(){n.off(e.support.transition.end).detach()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.detach()})}var t=this,n=this.tip(),r=e.Event("hide");this.$element.trigger(r);if(r.isDefaultPrevented())return;return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?i():n.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var t=this.$element[0];return e.extend({},typeof t.getBoundingClientRect=="function"?t.getBoundingClientRect():{width:t.offsetWidth,height:t.offsetHeight},this.$element.offset())},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(t){var n=t?e(t.currentTarget)[this.type](this._options).data(this.type):this;n.tip().hasClass("in")?n.hide():n.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var n=e.fn.tooltip;e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.fn.tooltip.noConflict=function(){return e.fn.tooltip=n,this}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=(typeof n.content=="function"?n.content.call(t[0]):n.content)||t.attr("data-content"),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}});var n=e.fn.popover;e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.fn.popover.noConflict=function(){return e.fn.popover=n,this}}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var n=e(this),r=n.data("target")||n.attr("href"),i=/^#\w/.test(r)&&e(r);return i&&i.length&&[[i.position().top+(!e.isWindow(t.$scrollElement.get(0))&&t.$scrollElement.scrollTop()),r]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}};var n=e.fn.scrollspy;e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e.fn.scrollspy.noConflict=function(){return e.fn.scrollspy=n,this},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active:last a")[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}};var n=e.fn.tab;e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e.fn.tab.noConflict=function(){return e.fn.tab=n,this},e(document).on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.source=this.options.source,this.$menu=e(this.options.menu),this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.position(),{height:this.$element[0].offsetHeight});return this.$menu.insertAfter(this.$element).css({top:t.top+t.height,left:t.left}).show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("focus",e.proxy(this.focus,this)).on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),this.eventSupported("keydown")&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this)).on("mouseleave","li",e.proxy(this.mouseleave,this))},eventSupported:function(e){var t=e in this.$element;return t||(this.$element.setAttribute(e,"return;"),t=typeof this.$element[e]=="function"),t},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},focus:function(e){this.focused=!0},blur:function(e){this.focused=!1,!this.mousedover&&this.shown&&this.hide()},click:function(e){e.stopPropagation(),e.preventDefault(),this.select(),this.$element.focus()},mouseenter:function(t){this.mousedover=!0,this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")},mouseleave:function(e){this.mousedover=!1,!this.focused&&this.shown&&this.hide()}};var n=e.fn.typeahead;e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e.fn.typeahead.noConflict=function(){return e.fn.typeahead=n,this},e(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;n.typeahead(n.data())})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)).on("click.affix.data-api",e.proxy(function(){setTimeout(e.proxy(this.checkPosition,this),1)},this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))};var n=e.fn.affix;e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e.fn.affix.noConflict=function(){return e.fn.affix=n,this},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); |
| 1 | +/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license | ||
| 2 | +//@ sourceMappingURL=jquery-1.10.2.min.map | ||
| 3 | +*/ | ||
| 4 | +(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t | ||
| 5 | +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); | ||
| 6 | +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window); |
此 diff 太大无法显示。
trunk/research/players/js/jwplayer.flash.swf
0 → 100644
不能预览此文件类型
trunk/research/players/js/jwplayer.html5.js
0 → 100644
此 diff 太大无法显示。
trunk/research/players/js/jwplayer.js
0 → 100644
| 1 | +"undefined"==typeof jwplayer&&(jwplayer=function(f){if(jwplayer.api)return jwplayer.api.selectPlayer(f)},jwplayer.version="6.4.3359",jwplayer.vid=document.createElement("video"),jwplayer.audio=document.createElement("audio"),jwplayer.source=document.createElement("source"),function(f){function a(g){return function(){return c(g)}}var l=document,e=window,j=navigator,b=f.utils=function(){};b.exists=function(g){switch(typeof g){case "string":return 0<g.length;case "object":return null!==g;case "undefined":return!1}return!0}; | ||
| 2 | +b.styleDimension=function(g){return g+(0<g.toString().indexOf("%")?"":"px")};b.getAbsolutePath=function(g,a){b.exists(a)||(a=l.location.href);if(b.exists(g)){var c;if(b.exists(g)){c=g.indexOf("://");var j=g.indexOf("?");c=0<c&&(0>j||j>c)}else c=void 0;if(c)return g;c=a.substring(0,a.indexOf("://")+3);var j=a.substring(c.length,a.indexOf("/",c.length+1)),d;0===g.indexOf("/")?d=g.split("/"):(d=a.split("?")[0],d=d.substring(c.length+j.length+1,d.lastIndexOf("/")),d=d.split("/").concat(g.split("/"))); | ||
| 3 | +for(var h=[],e=0;e<d.length;e++)d[e]&&(b.exists(d[e])&&"."!=d[e])&&(".."==d[e]?h.pop():h.push(d[e]));return c+j+"/"+h.join("/")}};b.extend=function(){var a=b.extend.arguments;if(1<a.length){for(var c=1;c<a.length;c++)b.foreach(a[c],function(c,d){try{b.exists(d)&&(a[0][c]=d)}catch(j){}});return a[0]}return null};b.log=function(a,b){"undefined"!=typeof console&&"undefined"!=typeof console.log&&(b?console.log(a,b):console.log(a))};var c=b.userAgentMatch=function(a){return null!==j.userAgent.toLowerCase().match(a)}; | ||
| 4 | +b.isIE=a(/msie/i);b.isFF=a(/firefox/i);b.isChrome=a(/chrome/i);b.isIOS=a(/iP(hone|ad|od)/i);b.isIPod=a(/iP(hone|od)/i);b.isIPad=a(/iPad/i);b.isSafari602=a(/Macintosh.*Mac OS X 10_8.*6\.0\.\d* Safari/i);b.isAndroid=function(a){return a?c(RegExp("android.*"+a,"i")):c(/android/i)};b.isMobile=function(){return b.isIOS()||b.isAndroid()};b.saveCookie=function(a,b){l.cookie="jwplayer."+a+"\x3d"+b+"; path\x3d/"};b.getCookies=function(){for(var a={},b=l.cookie.split("; "),c=0;c<b.length;c++){var d=b[c].split("\x3d"); | ||
| 5 | +0==d[0].indexOf("jwplayer.")&&(a[d[0].substring(9,d[0].length)]=d[1])}return a};b.typeOf=function(a){var b=typeof a;return"object"===b?!a?"null":a instanceof Array?"array":b:b};b.translateEventResponse=function(a,c){var d=b.extend({},c);a==f.events.JWPLAYER_FULLSCREEN&&!d.fullscreen?(d.fullscreen="true"==d.message?!0:!1,delete d.message):"object"==typeof d.data?(d=b.extend(d,d.data),delete d.data):"object"==typeof d.metadata&&b.deepReplaceKeyName(d.metadata,["__dot__","__spc__","__dsh__","__default__"], | ||
| 6 | +["."," ","-","default"]);b.foreach(["position","duration","offset"],function(a,b){d[b]&&(d[b]=Math.round(1E3*d[b])/1E3)});return d};b.flashVersion=function(){if(b.isAndroid())return 0;var a=j.plugins,d;try{if("undefined"!==a&&(d=a["Shockwave Flash"]))return parseInt(d.description.replace(/\D+(\d+)\..*/,"$1"))}catch(c){}if("undefined"!=typeof e.ActiveXObject)try{if(d=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return parseInt(d.GetVariable("$version").split(" ")[1].split(",")[0])}catch(f){}return 0}; | ||
| 7 | +b.getScriptPath=function(a){for(var b=l.getElementsByTagName("script"),d=0;d<b.length;d++){var c=b[d].src;if(c&&0<=c.indexOf(a))return c.substr(0,c.indexOf(a))}return""};b.deepReplaceKeyName=function(a,d,c){switch(f.utils.typeOf(a)){case "array":for(var j=0;j<a.length;j++)a[j]=f.utils.deepReplaceKeyName(a[j],d,c);break;case "object":b.foreach(a,function(b,h){var j;if(d instanceof Array&&c instanceof Array){if(d.length!=c.length)return;j=d}else j=[d];for(var e=b,l=0;l<j.length;l++)e=e.replace(RegExp(d[l], | ||
| 8 | +"g"),c[l]);a[e]=f.utils.deepReplaceKeyName(h,d,c);b!=e&&delete a[b]})}return a};var d=b.pluginPathType={ABSOLUTE:0,RELATIVE:1,CDN:2};b.getPluginPathType=function(a){if("string"==typeof a){a=a.split("?")[0];var c=a.indexOf("://");if(0<c)return d.ABSOLUTE;var j=a.indexOf("/");a=b.extension(a);return 0>c&&0>j&&(!a||!isNaN(a))?d.CDN:d.RELATIVE}};b.getPluginName=function(a){return a.replace(/^(.*\/)?([^-]*)-?.*\.(swf|js)$/,"$2")};b.getPluginVersion=function(a){return a.replace(/[^-]*-?([^\.]*).*$/,"$1")}; | ||
| 9 | +b.isYouTube=function(a){return-1<a.indexOf("youtube.com")||-1<a.indexOf("youtu.be")};b.isRtmp=function(a,b){return 0==a.indexOf("rtmp")||"rtmp"==b};b.foreach=function(a,b){var d,c;for(d in a)a.hasOwnProperty(d)&&(c=a[d],b(d,c))};b.isHTTPS=function(){return 0==e.location.href.indexOf("https")};b.repo=function(){var a=""+f.version.split(/\W/).splice(0,2).join("/")+"/";try{b.isHTTPS()&&(a=a.replace("http://","https://ssl."))}catch(d){}return a}}(jwplayer),function(f){var a="video/", | ||
| 10 | +l=f.foreach,e={mp4:a+"mp4",vorbis:"audio/ogg",ogg:a+"ogg",webm:a+"webm",aac:"audio/mp4",mp3:"audio/mpeg",hls:"application/vnd.apple.mpegurl"},j={mp4:e.mp4,f4v:e.mp4,m4v:e.mp4,mov:e.mp4,m4a:e.aac,f4a:e.aac,aac:e.aac,mp3:e.mp3,ogv:e.ogg,ogg:e.vorbis,oga:e.vorbis,webm:e.webm,m3u8:e.hls,hls:e.hls},a="video",a={flv:a,f4v:a,mov:a,m4a:a,m4v:a,mp4:a,aac:a,f4a:a,mp3:"sound",smil:"rtmp",m3u8:"hls",hls:"hls"},b=f.extensionmap={};l(j,function(a,d){b[a]={html5:d}});l(a,function(a,d){b[a]||(b[a]={});b[a].flash= | ||
| 11 | +d});b.types=e;b.mimeType=function(a){var b;l(e,function(j,e){!b&&e==a&&(b=j)});return b};b.extType=function(a){return b.mimeType(j[a])}}(jwplayer.utils),function(f){var a=f.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},l=document;f.scriptloader=function(e){function j(){c=a.ERROR;g.sendEvent(d.ERROR)}function b(){c=a.COMPLETE;g.sendEvent(d.COMPLETE)}var c=a.NEW,d=jwplayer.events,g=new d.eventdispatcher;f.extend(this,g);this.load=function(){var g=f.scriptloader.loaders[e];if(g&&(g.getStatus()== | ||
| 12 | +a.NEW||g.getStatus()==a.LOADING))g.addEventListener(d.ERROR,j),g.addEventListener(d.COMPLETE,b);else if(f.scriptloader.loaders[e]=this,c==a.NEW){c=a.LOADING;var m=l.createElement("script");m.addEventListener?(m.onload=b,m.onerror=j):m.readyState&&(m.onreadystatechange=function(){("loaded"==m.readyState||"complete"==m.readyState)&&b()});l.getElementsByTagName("head")[0].appendChild(m);m.src=e}};this.getStatus=function(){return c}};f.scriptloader.loaders={}}(jwplayer.utils),function(f){f.trim=function(a){return a.replace(/^\s*/, | ||
| 13 | +"").replace(/\s*$/,"")};f.pad=function(a,f,e){for(e||(e="0");a.length<f;)a=e+a;return a};f.xmlAttribute=function(a,f){for(var e=0;e<a.attributes.length;e++)if(a.attributes[e].name&&a.attributes[e].name.toLowerCase()==f.toLowerCase())return a.attributes[e].value.toString();return""};f.extension=function(a){if(!a||"rtmp"==a.substr(0,4))return"";a=a.substring(a.lastIndexOf("/")+1,a.length).split("?")[0].split("#")[0];if(-1<a.lastIndexOf("."))return a.substr(a.lastIndexOf(".")+1,a.length).toLowerCase()}; | ||
| 14 | +f.stringToColor=function(a){a=a.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");3==a.length&&(a=a.charAt(0)+a.charAt(0)+a.charAt(1)+a.charAt(1)+a.charAt(2)+a.charAt(2));return parseInt(a,16)}}(jwplayer.utils),function(f){f.key=function(a){var l,e,j;this.edition=function(){return j&&j.getTime()<(new Date).getTime()?"invalid":l};this.token=function(){return e};f.exists(a)||(a="");try{a=f.tea.decrypt(a,"36QXq4W@GSBV^teR");var b=a.split("/");(l=b[0])||(l="free");e=b[1];b[2]&&0<parseInt(b[2])&&(j=new Date,j.setTime(String(b[2])))}catch(c){l= | ||
| 15 | +"invalid"}}}(jwplayer.utils),function(f){var a=f.tea={};a.encrypt=function(j,b){if(0==j.length)return"";var c=a.strToLongs(e.encode(j));1>=c.length&&(c[1]=0);for(var d=a.strToLongs(e.encode(b).slice(0,16)),g=c.length,f=c[g-1],m=c[0],n,k=Math.floor(6+52/g),h=0;0<k--;){h+=2654435769;n=h>>>2&3;for(var r=0;r<g;r++)m=c[(r+1)%g],f=(f>>>5^m<<2)+(m>>>3^f<<4)^(h^m)+(d[r&3^n]^f),f=c[r]+=f}c=a.longsToStr(c);return l.encode(c)};a.decrypt=function(j,b){if(0==j.length)return"";for(var c=a.strToLongs(l.decode(j)), | ||
| 16 | +d=a.strToLongs(e.encode(b).slice(0,16)),g=c.length,f=c[g-1],m=c[0],n,k=2654435769*Math.floor(6+52/g);0!=k;){n=k>>>2&3;for(var h=g-1;0<=h;h--)f=c[0<h?h-1:g-1],f=(f>>>5^m<<2)+(m>>>3^f<<4)^(k^m)+(d[h&3^n]^f),m=c[h]-=f;k-=2654435769}c=a.longsToStr(c);c=c.replace(/\0+$/,"");return e.decode(c)};a.strToLongs=function(a){for(var b=Array(Math.ceil(a.length/4)),c=0;c<b.length;c++)b[c]=a.charCodeAt(4*c)+(a.charCodeAt(4*c+1)<<8)+(a.charCodeAt(4*c+2)<<16)+(a.charCodeAt(4*c+3)<<24);return b};a.longsToStr=function(a){for(var b= | ||
| 17 | +Array(a.length),c=0;c<a.length;c++)b[c]=String.fromCharCode(a[c]&255,a[c]>>>8&255,a[c]>>>16&255,a[c]>>>24&255);return b.join("")};var l={code:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\x3d",encode:function(a,b){var c,d,g,f,m=[],n="",k,h,r=l.code;h=("undefined"==typeof b?0:b)?e.encode(a):a;k=h.length%3;if(0<k)for(;3>k++;)n+="\x3d",h+="\x00";for(k=0;k<h.length;k+=3)c=h.charCodeAt(k),d=h.charCodeAt(k+1),g=h.charCodeAt(k+2),f=c<<16|d<<8|g,c=f>>18&63,d=f>>12&63,g=f>>6&63,f&=63,m[k/ | ||
| 18 | +3]=r.charAt(c)+r.charAt(d)+r.charAt(g)+r.charAt(f);m=m.join("");return m=m.slice(0,m.length-n.length)+n},decode:function(a,b){b="undefined"==typeof b?!1:b;var c,d,g,f,m,n=[],k,h=l.code;k=b?e.decode(a):a;for(var r=0;r<k.length;r+=4)c=h.indexOf(k.charAt(r)),d=h.indexOf(k.charAt(r+1)),f=h.indexOf(k.charAt(r+2)),m=h.indexOf(k.charAt(r+3)),g=c<<18|d<<12|f<<6|m,c=g>>>16&255,d=g>>>8&255,g&=255,n[r/4]=String.fromCharCode(c,d,g),64==m&&(n[r/4]=String.fromCharCode(c,d)),64==f&&(n[r/4]=String.fromCharCode(c)); | ||
| 19 | +f=n.join("");return b?e.decode(f):f}},e={encode:function(a){a=a.replace(/[\u0080-\u07ff]/g,function(a){a=a.charCodeAt(0);return String.fromCharCode(192|a>>6,128|a&63)});return a=a.replace(/[\u0800-\uffff]/g,function(a){a=a.charCodeAt(0);return String.fromCharCode(224|a>>12,128|a>>6&63,128|a&63)})},decode:function(a){a=a.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(a){a=(a.charCodeAt(0)&15)<<12|(a.charCodeAt(1)&63)<<6|a.charCodeAt(2)&63;return String.fromCharCode(a)});return a= | ||
| 20 | +a.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(a){a=(a.charCodeAt(0)&31)<<6|a.charCodeAt(1)&63;return String.fromCharCode(a)})}}}(jwplayer.utils),function(f){f.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow", | ||
| 21 | +JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels", | ||
| 22 | +JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_CAPTIONS_CHANGED:"jwplayerCaptionsChanged",JWPLAYER_CAPTIONS_LIST:"jwplayerCaptionsList",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_PLAYLIST_COMPLETE:"jwplayerPlaylistComplete",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_CONTROLS:"jwplayerViewControls", | ||
| 23 | +JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}}(jwplayer),function(f){var a=jwplayer.utils;f.eventdispatcher=function(f,e){var j,b;this.resetEventListeners=function(){j={};b=[]};this.resetEventListeners();this.addEventListener=function(b,d,g){try{a.exists(j[b])||(j[b]=[]),"string"==a.typeOf(d)&&(d=(new Function("return "+d))()),j[b].push({listener:d,count:g})}catch(e){a.log("error",e)}return!1};this.removeEventListener=function(b,d){if(j[b]){try{for(var g= | ||
| 24 | +0;g<j[b].length;g++)if(j[b][g].listener.toString()==d.toString()){j[b].splice(g,1);break}}catch(e){a.log("error",e)}return!1}};this.addGlobalListener=function(c,d){try{"string"==a.typeOf(c)&&(c=(new Function("return "+c))()),b.push({listener:c,count:d})}catch(g){a.log("error",g)}return!1};this.removeGlobalListener=function(c){if(c){try{for(var d=0;d<b.length;d++)if(b[d].listener.toString()==c.toString()){b.splice(d,1);break}}catch(g){a.log("error",g)}return!1}};this.sendEvent=function(c,d){a.exists(d)|| | ||
| 25 | +(d={});a.extend(d,{id:f,version:jwplayer.version,type:c});e&&a.log(c,d);if("undefined"!=a.typeOf(j[c]))for(var g=0;g<j[c].length;g++){try{j[c][g].listener(d)}catch(q){a.log("There was an error while handling a listener: "+q.toString(),j[c][g].listener)}j[c][g]&&(1===j[c][g].count?delete j[c][g]:0<j[c][g].count&&(j[c][g].count-=1))}for(g=0;g<b.length;g++){try{b[g].listener(d)}catch(m){a.log("There was an error while handling a listener: "+m.toString(),b[g].listener)}b[g]&&(1===b[g].count?delete b[g]: | ||
| 26 | +0<b[g].count&&(b[g].count-=1))}}}}(jwplayer.events),function(f){var a={},l={};f.plugins=function(){};f.plugins.loadPlugins=function(e,j){l[e]=new f.plugins.pluginloader(new f.plugins.model(a),j);return l[e]};f.plugins.registerPlugin=function(e,j,b,c){var d=f.utils.getPluginName(e);a[d]||(a[d]=new f.plugins.plugin(e));a[d].registerPlugin(e,j,b,c)}}(jwplayer),function(f){f.plugins.model=function(a){this.addPlugin=function(l){var e=f.utils.getPluginName(l);a[e]||(a[e]=new f.plugins.plugin(l));return a[e]}; | ||
| 27 | +this.getPlugins=function(){return a}}}(jwplayer),function(f){var a=jwplayer.utils,l=jwplayer.events;f.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2};f.plugin=function(e){function j(){switch(a.getPluginPathType(e)){case a.pluginPathType.ABSOLUTE:return e;case a.pluginPathType.RELATIVE:return a.getAbsolutePath(e,window.location.href)}}function b(){n=setTimeout(function(){d=a.loaderstatus.COMPLETE;k.sendEvent(l.COMPLETE)},1E3)}function c(){d=a.loaderstatus.ERROR;k.sendEvent(l.ERROR)}var d=a.loaderstatus.NEW, | ||
| 28 | +g,q,m,n,k=new l.eventdispatcher;a.extend(this,k);this.load=function(){if(d==a.loaderstatus.NEW)if(0<e.lastIndexOf(".swf"))g=e,d=a.loaderstatus.COMPLETE,k.sendEvent(l.COMPLETE);else if(a.getPluginPathType(e)==a.pluginPathType.CDN)d=a.loaderstatus.COMPLETE,k.sendEvent(l.COMPLETE);else{d=a.loaderstatus.LOADING;var h=new a.scriptloader(j());h.addEventListener(l.COMPLETE,b);h.addEventListener(l.ERROR,c);h.load()}};this.registerPlugin=function(b,c,e,j){n&&(clearTimeout(n),n=void 0);m=c;e&&j?(g=j,q=e):"string"== | ||
| 29 | +typeof e?g=e:"function"==typeof e?q=e:!e&&!j&&(g=b);d=a.loaderstatus.COMPLETE;k.sendEvent(l.COMPLETE)};this.getStatus=function(){return d};this.getPluginName=function(){return a.getPluginName(e)};this.getFlashPath=function(){if(g)switch(a.getPluginPathType(g)){case a.pluginPathType.ABSOLUTE:return g;case a.pluginPathType.RELATIVE:return 0<e.lastIndexOf(".swf")?a.getAbsolutePath(g,window.location.href):a.getAbsolutePath(g,j())}return null};this.getJS=function(){return q};this.getTarget=function(){return m}; | ||
| 30 | +this.getPluginmode=function(){if("undefined"!=typeof g&&"undefined"!=typeof q)return f.pluginmodes.HYBRID;if("undefined"!=typeof g)return f.pluginmodes.FLASH;if("undefined"!=typeof q)return f.pluginmodes.JAVASCRIPT};this.getNewInstance=function(a,b,d){return new q(a,b,d)};this.getURL=function(){return e}}}(jwplayer.plugins),function(f){var a=f.utils,l=f.events,e=a.foreach;f.plugins.pluginloader=function(j,b){function c(){m?h.sendEvent(l.ERROR,{message:n}):q||(q=!0,g=a.loaderstatus.COMPLETE,h.sendEvent(l.COMPLETE))} | ||
| 31 | +function d(){k||c();if(!q&&!m){var b=0,d=j.getPlugins();a.foreach(k,function(g){g=a.getPluginName(g);var e=d[g];g=e.getJS();var h=e.getTarget(),e=e.getStatus();if(e==a.loaderstatus.LOADING||e==a.loaderstatus.NEW)b++;else if(g&&(!h||parseFloat(h)>parseFloat(f.version)))m=!0,n="Incompatible player version",c()});0==b&&c()}}var g=a.loaderstatus.NEW,q=!1,m=!1,n,k=b,h=new l.eventdispatcher;a.extend(this,h);this.setupPlugins=function(b,d,c){var g={length:0,plugins:{}},h=0,f={},r=j.getPlugins();e(d.plugins, | ||
| 32 | +function(e,j){var k=a.getPluginName(e),l=r[k],m=l.getFlashPath(),n=l.getJS(),q=l.getURL();m&&(g.plugins[m]=a.extend({},j),g.plugins[m].pluginmode=l.getPluginmode(),g.length++);try{if(n&&d.plugins&&d.plugins[q]){var v=document.createElement("div");v.id=b.id+"_"+k;v.style.position="absolute";v.style.top=0;v.style.zIndex=h+10;f[k]=l.getNewInstance(b,a.extend({},d.plugins[q]),v);h++;b.onReady(c(f[k],v,!0));b.onResize(c(f[k],v))}}catch(B){a.log("ERROR: Failed to load "+k+".")}});b.plugins=f;return g}; | ||
| 33 | +this.load=function(){if(!(a.exists(b)&&"object"!=a.typeOf(b))){g=a.loaderstatus.LOADING;e(b,function(b){a.exists(b)&&(b=j.addPlugin(b),b.addEventListener(l.COMPLETE,d),b.addEventListener(l.ERROR,r))});var c=j.getPlugins();e(c,function(a,b){b.load()})}d()};var r=this.pluginFailed=function(){m||(m=!0,n="File not found",c())};this.getStatus=function(){return g}}}(jwplayer),function(f){f.playlist=function(a){var l=[];if("array"==f.utils.typeOf(a))for(var e=0;e<a.length;e++)l.push(new f.playlist.item(a[e])); | ||
| 34 | +else l.push(new f.playlist.item(a));return l}}(jwplayer),function(f){var a=f.item=function(l){var e=jwplayer.utils,j=e.extend({},a.defaults,l);j.tracks=e.exists(l.tracks)?l.tracks:[];0==j.sources.length&&(j.sources=[new f.source(j)]);for(var b=0;b<j.sources.length;b++){var c=j.sources[b]["default"];j.sources[b]["default"]=c?"true"==c.toString():!1;j.sources[b]=new f.source(j.sources[b])}if(j.captions&&!e.exists(l.tracks)){for(l=0;l<j.captions.length;l++)j.tracks.push(j.captions[l]);delete j.captions}for(b= | ||
| 35 | +0;b<j.tracks.length;b++)j.tracks[b]=new f.track(j.tracks[b]);return j};a.defaults={description:"",image:"",mediaid:"",title:"",sources:[],tracks:[]}}(jwplayer.playlist),function(f){var a=jwplayer.utils,l={file:void 0,label:void 0,type:void 0,"default":void 0};f.source=function(e){var j=a.extend({},l);a.foreach(l,function(b){a.exists(e[b])&&(j[b]=e[b],delete e[b])});j.type&&0<j.type.indexOf("/")&&(j.type=a.extensionmap.mimeType(j.type));"m3u8"==j.type&&(j.type="hls");"smil"==j.type&&(j.type="rtmp"); | ||
| 36 | +return j}}(jwplayer.playlist),function(f){var a=jwplayer.utils,l={file:void 0,label:void 0,kind:"captions","default":!1};f.track=function(e){var j=a.extend({},l);e||(e={});a.foreach(l,function(b){a.exists(e[b])&&(j[b]=e[b],delete e[b])});return j}}(jwplayer.playlist),function(f){var a=f.utils,l=f.events,e=document,j=f.embed=function(b){function c(b,d){a.foreach(d,function(a,d){"function"==typeof b[a]&&b[a].call(b,d)})}function d(a){q(n,t+a.message)}function g(){q(n,t+"No playable sources found")} | ||
| 37 | +function q(b,d){if(m.fallback){var c=b.style;c.backgroundColor="#000";c.color="#FFF";c.width=a.styleDimension(m.width);c.height=a.styleDimension(m.height);c.display="table";c.opacity=1;var c=document.createElement("p"),g=c.style;g.verticalAlign="middle";g.textAlign="center";g.display="table-cell";g.font="15px/20px Arial, Helvetica, sans-serif";c.innerHTML=d.replace(":",":\x3cbr\x3e");b.innerHTML="";b.appendChild(c)}}var m=new j.config(b.config),n,k,h,r=m.width,p=m.height,t="Error loading player: ", | ||
| 38 | +s=f.plugins.loadPlugins(b.id,m.plugins);m.fallbackDiv&&(h=m.fallbackDiv,delete m.fallbackDiv);m.id=b.id;k=e.getElementById(b.id);m.aspectratio?b.config.aspectratio=m.aspectratio:delete b.config.aspectratio;n=e.createElement("div");n.id=k.id;n.style.width=0<r.toString().indexOf("%")?r:r+"px";n.style.height=0<p.toString().indexOf("%")?p:p+"px";k.parentNode.replaceChild(n,k);f.embed.errorScreen=q;s.addEventListener(l.COMPLETE,function(){if("array"==a.typeOf(m.playlist)&&2>m.playlist.length&&(0==m.playlist.length|| | ||
| 39 | +!m.playlist[0].sources||0==m.playlist[0].sources.length))g();else if(s.getStatus()==a.loaderstatus.COMPLETE){for(var e=0;e<m.modes.length;e++)if(m.modes[e].type&&j[m.modes[e].type]){var f=a.extend({},m),r=new j[m.modes[e].type](n,m.modes[e],f,s,b);if(r.supportsConfig())return r.addEventListener(l.ERROR,d),r.embed(),c(b,f.events),b}m.fallback?(a.log("No suitable players found and fallback enabled"),new j.download(n,m,g)):(a.log("No suitable players found and fallback disabled"),n.parentNode.replaceChild(h, | ||
| 40 | +n))}});s.addEventListener(l.ERROR,function(a){q(n,"Could not load plugins: "+a.message)});s.load();return b}}(jwplayer),function(f){function a(a){if(a.playlist)for(var c=0;c<a.playlist.length;c++)a.playlist[c]=new j(a.playlist[c]);else{var d={};e.foreach(j.defaults,function(c){l(a,d,c)});d.sources||(a.levels?(d.sources=a.levels,delete a.levels):(c={},l(a,c,"file"),l(a,c,"type"),d.sources=c.file?[c]:[]));a.playlist=[new j(d)]}}function l(a,c,d){e.exists(a[d])&&(c[d]=a[d],delete a[d])}var e=f.utils, | ||
| 41 | +j=f.playlist.item;(f.embed.config=function(b){var c={fallback:!0,height:270,primary:"html5",width:480,base:b.base?b.base:e.getScriptPath("jwplayer.js"),aspectratio:""};b=e.extend(c,f.defaults,b);var c={type:"html5",src:b.base+"jwplayer.html5.js"},d={type:"flash",src:b.base+"jwplayer.flash.swf"};b.modes="flash"==b.primary?[d,c]:[c,d];b.listbar&&(b.playlistsize=b.listbar.size,b.playlistposition=b.listbar.position);b.flashplayer&&(d.src=b.flashplayer);b.html5player&&(c.src=b.html5player);a(b);d=b.aspectratio; | ||
| 42 | +if("string"!=typeof d||!e.exists(d))c=0;else{var g=d.indexOf(":");-1==g?c=0:(c=parseFloat(d.substr(0,g)),d=parseFloat(d.substr(g+1)),c=0>=c||0>=d?0:100*(d/c)+"%")}-1==b.width.toString().indexOf("%")?delete b.aspectratio:c?b.aspectratio=c:delete b.aspectratio;return b}).addConfig=function(b,c){a(c);return e.extend(b,c)}}(jwplayer),function(f){var a=f.utils,l=document;f.embed.download=function(e,f,b){function c(b,d){for(var c=l.querySelectorAll(b),g=0;g<c.length;g++)a.foreach(d,function(a,b){c[g].style[a]= | ||
| 43 | +b})}function d(a,b,d){a=l.createElement(a);b&&(a.className="jwdownload"+b);d&&d.appendChild(a);return a}var g=a.extend({},f),q=g.width?g.width:480,m=g.height?g.height:320,n;f=f.logo?f.logo:{prefix:a.repo(),file:"logo.png",margin:10};var k,h,r,g=g.playlist,p,t=["mp4","aac","mp3"];if(g&&g.length){p=g[0];n=p.sources;for(g=0;g<n.length;g++){var s=n[g],u=s.type?s.type:a.extensionmap.extType(a.extension(s.file));s.file&&a.foreach(t,function(b){u==t[b]?(k=s.file,h=p.image):a.isYouTube(s.file)&&(r=s.file)})}k? | ||
| 44 | +(n=k,b=h,e&&(g=d("a","display",e),d("div","icon",g),d("div","logo",g),n&&g.setAttribute("href",a.getAbsolutePath(n))),g="#"+e.id+" .jwdownload",e.style.width="",e.style.height="",c(g+"display",{width:a.styleDimension(Math.max(320,q)),height:a.styleDimension(Math.max(180,m)),background:"black center no-repeat "+(b?"url("+b+")":""),backgroundSize:"contain",position:"relative",border:"none",display:"block"}),c(g+"display div",{position:"absolute",width:"100%",height:"100%"}),c(g+"logo",{top:f.margin+ | ||
| 45 | +"px",right:f.margin+"px",background:"top right no-repeat url("+f.prefix+f.file+")"}),c(g+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgNJREFUeNrs28lqwkAYB/CZqNVDDj2r6FN41QeIy8Fe+gj6BL275Q08u9FbT8ZdwVfotSBYEPUkxFOoks4EKiJdaDuTjMn3wWBO0V/+sySR8SNSqVRKIR8qaXHkzlqS9jCfzzWcTCYp9hF5o+59sVjsiRzcegSckFzcjT+ruN80TeSlAjCAAXzdJSGPFXRpAAMYwACGZQkSdhG4WCzehMNhqV6vG6vVSrirKVEw66YoSqDb7cqlUilE8JjHd/y1MQefVzqdDmiaJpfLZWHgXMHn8F6vJ1cqlVAkEsGuAn83J4gAd2RZymQygX6/L1erVQt+9ZPWb+CDwcCC2zXGJaewl/DhcHhK3DVj+KfKZrMWvFarcYNLomAv4aPRSFZVlTlcSPA5fDweW/BoNIqFnKV53JvncjkLns/n/cLdS+92O7RYLLgsKfv9/t8XlDn4eDyiw+HA9Jyz2eyt0+kY2+3WFC5hluej0Ha7zQQq9PPwdDq1Et1sNsx/nFBgCqWJ8oAK1aUptNVqcYWewE4nahfU0YQnk4ntUEfGMIU2m01HoLaCKbTRaDgKtaVLk9tBYaBcE/6Artdr4RZ5TB6/dC+9iIe/WgAMYADDpAUJAxjAAAYwgGFZgoS/AtNNTF7Z2bL0BYPBV3Jw5xFwwWcYxgtBP5OkE8i9G7aWGOOCruvauwADALMLMEbKf4SdAAAAAElFTkSuQmCC)"})): | ||
| 46 | +r?(f=r,e=d("embed","",e),e.src="http://www.youtube.com/v/"+/v[=\/](\w*)|\/(\w+)$|^(\w+)$/i.exec(f).slice(1).join(""),e.type="application/x-shockwave-flash",e.width=q,e.height=m):b()}}}(jwplayer),function(f){var a=f.utils,l=f.events,e={};(f.embed.flash=function(j,b,c,d,g){function q(a,b,d){var c=document.createElement("param");c.setAttribute("name",b);c.setAttribute("value",d);a.appendChild(c)}function m(a,b,d){return function(){try{d&&document.getElementById(g.id+"_wrapper").appendChild(b);var c= | ||
| 47 | +document.getElementById(g.id).getPluginConfig("display");"function"==typeof a.resize&&a.resize(c.width,c.height);b.style.left=c.x;b.style.top=c.h}catch(e){}}}function n(b){if(!b)return{};var d={},c=[];a.foreach(b,function(b,g){var e=a.getPluginName(b);c.push(b);a.foreach(g,function(a,b){d[e+"."+a]=b})});d.plugins=c.join(",");return d}var k=new f.events.eventdispatcher,h=a.flashVersion();a.extend(this,k);this.embed=function(){c.id=g.id;if(10>h)return k.sendEvent(l.ERROR,{message:"Flash version must be 10.0 or greater"}), | ||
| 48 | +!1;var f,p,t=g.config.listbar,s=a.extend({},c);if(j.id+"_wrapper"==j.parentNode.id)f=document.getElementById(j.id+"_wrapper");else{f=document.createElement("div");p=document.createElement("div");p.style.display="none";p.id=j.id+"_aspect";f.id=j.id+"_wrapper";f.style.position="relative";f.style.display="block";f.style.width=a.styleDimension(s.width);f.style.height=a.styleDimension(s.height);if(g.config.aspectratio){var u=parseFloat(g.config.aspectratio);p.style.display="block";p.style.marginTop=g.config.aspectratio; | ||
| 49 | +f.style.height="auto";f.style.display="inline-block";t&&("bottom"==t.position?p.style.paddingBottom=t.size+"px":"right"==t.position&&(p.style.marginBottom=-1*t.size*(u/100)+"px"))}j.parentNode.replaceChild(f,j);f.appendChild(j);f.appendChild(p)}f=d.setupPlugins(g,s,m);0<f.length?a.extend(s,n(f.plugins)):delete s.plugins;"undefined"!=typeof s["dock.position"]&&"false"==s["dock.position"].toString().toLowerCase()&&(s.dock=s["dock.position"],delete s["dock.position"]);f=s.wmode?s.wmode:s.height&&40>= | ||
| 50 | +s.height?"transparent":"opaque";p="height width modes events primary base fallback volume".split(" ");for(t=0;t<p.length;t++)delete s[p[t]];p=a.getCookies();a.foreach(p,function(a,b){"undefined"==typeof s[a]&&(s[a]=b)});p=window.location.href.split("/");p.splice(p.length-1,1);p=p.join("/");s.base=p+"/";e[j.id]=s;a.isIE()?(p='\x3cobject classid\x3d"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" " width\x3d"100%" height\x3d"100%"id\x3d"'+j.id+'" name\x3d"'+j.id+'" tabindex\x3d0""\x3e',p+='\x3cparam name\x3d"movie" value\x3d"'+ | ||
| 51 | +b.src+'"\x3e',p+='\x3cparam name\x3d"allowfullscreen" value\x3d"true"\x3e\x3cparam name\x3d"allowscriptaccess" value\x3d"always"\x3e',p+='\x3cparam name\x3d"seamlesstabbing" value\x3d"true"\x3e',p+='\x3cparam name\x3d"wmode" value\x3d"'+f+'"\x3e',p+='\x3cparam name\x3d"bgcolor" value\x3d"#000000"\x3e',p+="\x3c/object\x3e",j.outerHTML=p,f=document.getElementById(j.id)):(p=document.createElement("object"),p.setAttribute("type","application/x-shockwave-flash"),p.setAttribute("data",b.src),p.setAttribute("width", | ||
| 52 | +"100%"),p.setAttribute("height","100%"),p.setAttribute("bgcolor","#000000"),p.setAttribute("id",j.id),p.setAttribute("name",j.id),p.setAttribute("tabindex",0),q(p,"allowfullscreen","true"),q(p,"allowscriptaccess","always"),q(p,"seamlesstabbing","true"),q(p,"wmode",f),j.parentNode.replaceChild(p,j),f=p);g.config.aspectratio&&(f.style.position="absolute");g.container=f;g.setPlayer(f,"flash")};this.supportsConfig=function(){if(h)if(c){if("string"==a.typeOf(c.playlist))return!0;try{var b=c.playlist[0].sources; | ||
| 53 | +if("undefined"==typeof b)return!0;for(var d=0;d<b.length;d++){var g;if(g=b[d].file){var e=b[d].file,f=b[d].type;if(a.isYouTube(e)||a.isRtmp(e,f)||"hls"==f)g=!0;else{var j=a.extensionmap[f?f:a.extension(e)];g=!j?!1:!!j.flash}}if(g)return!0}}catch(k){}}else return!0;return!1}}).getVars=function(a){return e[a]}}(jwplayer),function(f){var a=f.utils,l=a.extensionmap,e=f.events;f.embed.html5=function(j,b,c,d,g){function q(a,b,d){return function(){try{var c=document.querySelector("#"+j.id+" .jwmain");d&& | ||
| 54 | +c.appendChild(b);"function"==typeof a.resize&&(a.resize(c.clientWidth,c.clientHeight),setTimeout(function(){a.resize(c.clientWidth,c.clientHeight)},400));b.left=c.style.left;b.top=c.style.top}catch(g){}}}function m(a){n.sendEvent(a.type,{message:"HTML5 player not found"})}var n=this,k=new e.eventdispatcher;a.extend(n,k);n.embed=function(){if(f.html5){d.setupPlugins(g,c,q);j.innerHTML="";var h=f.utils.extend({},c);delete h.volume;h=new f.html5.player(h);g.container=document.getElementById(g.id);g.setPlayer(h, | ||
| 55 | +"html5")}else h=new a.scriptloader(b.src),h.addEventListener(e.ERROR,m),h.addEventListener(e.COMPLETE,n.embed),h.load()};n.supportsConfig=function(){if(f.vid.canPlayType)try{if("string"==a.typeOf(c.playlist))return!0;for(var b=c.playlist[0].sources,d=0;d<b.length;d++){var g;var e=b[d].file,j=b[d].type;if(null!==navigator.userAgent.match(/BlackBerry/i)||a.isAndroid()&&("m3u"==a.extension(e)||"m3u8"==a.extension(e))||a.isRtmp(e,j))g=!1;else{var k=l[j?j:a.extension(e)],m;if(!k||k.flash&&!k.html5)m=!1; | ||
| 56 | +else{var n=k.html5,q=f.vid;if(n)try{m=q.canPlayType(n)?!0:!1}catch(z){m=!1}else m=!0}g=m}if(g)return!0}}catch(A){}return!1}}}(jwplayer),function(f){var a=f.embed,l=f.utils,e=l.extend(function(e){var b=l.repo(),c=l.extend({},f.defaults),d=l.extend({},c,e.config),g=e.config,q=d.plugins,m=d.analytics,n=b+"jwpsrv.js",k=b+"sharing.js",h=b+"related.js",r=b+"gapro.js",c=f.key?f.key:c.key,p="premium"/*(new f.utils.key(c)).edition()*/,q=q?q:{}; /*alert(c);*/ "ads"==p&&d.advertising&&(d.advertising.client.match(".js$|.swf$")?q[d.advertising.client]= | ||
| 57 | +d.advertising:q[b+d.advertising.client+".js"]=d.advertising);delete g.advertising;g.key=c;d.analytics&&(d.analytics.client&&d.analytics.client.match(".js$|.swf$"))&&(n=d.analytics.client);delete g.analytics;if("free"==p||!m||!1!==m.enabled)q[n]=m?m:{};delete q.sharing;delete q.related;if("premium"==p||"ads"==p)d.sharing&&(d.sharing.client&&d.sharing.client.match(".js$|.swf$")&&(k=d.sharing.client),q[k]=d.sharing),d.related&&(d.related.client&&d.related.client.match(".js$|.swf$")&&(h=d.related.client), | ||
| 58 | +q[h]=d.related),d.ga&&(d.ga.client&&d.ga.client.match(".js$|.swf$")&&(r=d.ga.client),q[r]=d.ga),d.skin&&(g.skin=d.skin.replace(/^(beelden|bekle|five|glow|modieus|roundster|stormtrooper|vapor)$/i,l.repo()+"skins/$1.xml"));g.plugins=q;return new a(e)},a);f.embed=e}(jwplayer),function(f){var a=[],l=f.utils,e=f.events,j=e.state,b=document,c=f.api=function(a){function g(a,b){return function(d){return b(a,d)}}function q(a,b){p[a]||(p[a]=[],n(e.JWPLAYER_PLAYER_STATE,function(b){var d=b.newstate;b=b.oldstate; | ||
| 59 | +if(d==a){var c=p[d];if(c)for(var g=0;g<c.length;g++)"function"==typeof c[g]&&c[g].call(this,{oldstate:b,newstate:d})}}));p[a].push(b);return h}function m(a,b){try{a.jwAddEventListener(b,'function(dat) { jwplayer("'+h.id+'").dispatchEvent("'+b+'", dat); }')}catch(d){l.log("Could not add internal listener")}}function n(a,b){r[a]||(r[a]=[],t&&s&&m(t,a));r[a].push(b);return h}function k(){if(s){for(var a=arguments[0],b=[],d=1;d<arguments.length;d++)b.push(arguments[d]);if("undefined"!=typeof t&&"function"== | ||
| 60 | +typeof t[a])switch(b.length){case 4:return t[a](b[0],b[1],b[2],b[3]);case 3:return t[a](b[0],b[1],b[2]);case 2:return t[a](b[0],b[1]);case 1:return t[a](b[0]);default:return t[a]()}return null}u.push(arguments)}var h=this,r={},p={},t=void 0,s=!1,u=[],w=void 0,x={},y={};h.container=a;h.id=a.id;h.getBuffer=function(){return k("jwGetBuffer")};h.getContainer=function(){return h.container};h.addButton=function(a,b,d,c){try{y[c]=d,k("jwDockAddButton",a,b,"jwplayer('"+h.id+"').callback('"+c+"')",c)}catch(g){l.log("Could not add dock button"+ | ||
| 61 | +g.message)}};h.removeButton=function(a){k("jwDockRemoveButton",a)};h.callback=function(a){if(y[a])y[a]()};h.forceState=function(a){k("jwForceState",a);return h};h.releaseState=function(){return k("jwReleaseState")};h.getDuration=function(){return k("jwGetDuration")};h.getFullscreen=function(){return k("jwGetFullscreen")};h.getStretching=function(){return k("jwGetStretching")};h.getHeight=function(){return k("jwGetHeight")};h.getLockState=function(){return k("jwGetLockState")};h.getMeta=function(){return h.getItemMeta()}; | ||
| 62 | +h.getMute=function(){return k("jwGetMute")};h.getPlaylist=function(){var a=k("jwGetPlaylist");"flash"==h.renderingMode&&l.deepReplaceKeyName(a,["__dot__","__spc__","__dsh__","__default__"],["."," ","-","default"]);return a};h.getPlaylistItem=function(a){l.exists(a)||(a=h.getCurrentItem());return h.getPlaylist()[a]};h.getPosition=function(){return k("jwGetPosition")};h.getRenderingMode=function(){return h.renderingMode};h.getState=function(){return k("jwGetState")};h.getVolume=function(){return k("jwGetVolume")}; | ||
| 63 | +h.getWidth=function(){return k("jwGetWidth")};h.setFullscreen=function(a){l.exists(a)?k("jwSetFullscreen",a):k("jwSetFullscreen",!k("jwGetFullscreen"));return h};h.setStretching=function(a){k("jwSetStretching",a);return h};h.setMute=function(a){l.exists(a)?k("jwSetMute",a):k("jwSetMute",!k("jwGetMute"));return h};h.lock=function(){return h};h.unlock=function(){return h};h.load=function(a){k("jwLoad",a);return h};h.playlistItem=function(a){k("jwPlaylistItem",parseInt(a));return h};h.playlistPrev=function(){k("jwPlaylistPrev"); | ||
| 64 | +return h};h.playlistNext=function(){k("jwPlaylistNext");return h};h.resize=function(a,d){if("flash"!=h.renderingMode){var c=document.getElementById(h.id);c.className=c.className.replace(/\s+aspectMode/,"");c.style.display="block";k("jwResize",a,d)}else{var c=b.getElementById(h.id+"_wrapper"),g=b.getElementById(h.id+"_aspect");g&&(g.style.display="none");c&&(c.style.display="block",c.style.width=l.styleDimension(a),c.style.height=l.styleDimension(d))}return h};h.play=function(a){"undefined"==typeof a? | ||
| 65 | +(a=h.getState(),a==j.PLAYING||a==j.BUFFERING?k("jwPause"):k("jwPlay")):k("jwPlay",a);return h};h.pause=function(a){"undefined"==typeof a?(a=h.getState(),a==j.PLAYING||a==j.BUFFERING?k("jwPause"):k("jwPlay")):k("jwPause",a);return h};h.stop=function(){k("jwStop");return h};h.seek=function(a){k("jwSeek",a);return h};h.setVolume=function(a){k("jwSetVolume",a);return h};h.loadInstream=function(a,b){return w=new c.instream(this,t,a,b)};h.getQualityLevels=function(){return k("jwGetQualityLevels")};h.getCurrentQuality= | ||
| 66 | +function(){return k("jwGetCurrentQuality")};h.setCurrentQuality=function(a){k("jwSetCurrentQuality",a)};h.getCaptionsList=function(){return k("jwGetCaptionsList")};h.getCurrentCaptions=function(){return k("jwGetCurrentCaptions")};h.setCurrentCaptions=function(a){k("jwSetCurrentCaptions",a)};h.getControls=function(){return k("jwGetControls")};h.getSafeRegion=function(){return k("jwGetSafeRegion")};h.setControls=function(a){k("jwSetControls",a)};h.destroyPlayer=function(){k("jwPlayerDestroy")};var z= | ||
| 67 | +{onBufferChange:e.JWPLAYER_MEDIA_BUFFER,onBufferFull:e.JWPLAYER_MEDIA_BUFFER_FULL,onError:e.JWPLAYER_ERROR,onFullscreen:e.JWPLAYER_FULLSCREEN,onMeta:e.JWPLAYER_MEDIA_META,onMute:e.JWPLAYER_MEDIA_MUTE,onPlaylist:e.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:e.JWPLAYER_PLAYLIST_ITEM,onPlaylistComplete:e.JWPLAYER_PLAYLIST_COMPLETE,onReady:e.API_READY,onResize:e.JWPLAYER_RESIZE,onComplete:e.JWPLAYER_MEDIA_COMPLETE,onSeek:e.JWPLAYER_MEDIA_SEEK,onTime:e.JWPLAYER_MEDIA_TIME,onVolume:e.JWPLAYER_MEDIA_VOLUME, | ||
| 68 | +onBeforePlay:e.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:e.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:e.JWPLAYER_DISPLAY_CLICK,onControls:e.JWPLAYER_CONTROLS,onQualityLevels:e.JWPLAYER_MEDIA_LEVELS,onQualityChange:e.JWPLAYER_MEDIA_LEVEL_CHANGED,onCaptionsList:e.JWPLAYER_CAPTIONS_LIST,onCaptionsChange:e.JWPLAYER_CAPTIONS_CHANGED};l.foreach(z,function(a){h[a]=g(z[a],n)});var A={onBuffer:j.BUFFERING,onPause:j.PAUSED,onPlay:j.PLAYING,onIdle:j.IDLE};l.foreach(A,function(a){h[a]=g(A[a],q)});h.remove= | ||
| 69 | +function(){if(!s)throw"Cannot call remove() before player is ready";u=[];c.destroyPlayer(this.id)};h.setup=function(a){if(f.embed){var d=b.getElementById(h.id);d&&(a.fallbackDiv=d);d=h;u=[];c.destroyPlayer(d.id);d=f(h.id);d.config=a;return new f.embed(d)}return h};h.registerPlugin=function(a,b,d,c){f.plugins.registerPlugin(a,b,d,c)};h.setPlayer=function(a,b){t=a;h.renderingMode=b};h.detachMedia=function(){if("html5"==h.renderingMode)return k("jwDetachMedia")};h.attachMedia=function(a){if("html5"== | ||
| 70 | +h.renderingMode)return k("jwAttachMedia",a)};h.dispatchEvent=function(a,b){if(r[a])for(var d=l.translateEventResponse(a,b),c=0;c<r[a].length;c++)if("function"==typeof r[a][c])try{a==e.JWPLAYER_PLAYLIST_LOADED&&l.deepReplaceKeyName(d.playlist,["__dot__","__spc__","__dsh__","__default__"],["."," ","-","default"]),r[a][c].call(this,d)}catch(g){l.log("There was an error calling back an event handler")}};h.dispatchInstreamEvent=function(a){w&&w.dispatchEvent(a,arguments)};h.callInternal=k;h.playerReady= | ||
| 71 | +function(a){s=!0;t||h.setPlayer(b.getElementById(a.id));h.container=b.getElementById(h.id);l.foreach(r,function(a){m(t,a)});n(e.JWPLAYER_PLAYLIST_ITEM,function(){x={}});n(e.JWPLAYER_MEDIA_META,function(a){l.extend(x,a.metadata)});for(h.dispatchEvent(e.API_READY);0<u.length;)k.apply(this,u.shift())};h.getItemMeta=function(){return x};h.getCurrentItem=function(){return k("jwGetPlaylistIndex")};return h};c.selectPlayer=function(d){var g;l.exists(d)||(d=0);d.nodeType?g=d:"string"==typeof d&&(g=b.getElementById(d)); | ||
| 72 | +return g?(d=c.playerById(g.id))?d:c.addPlayer(new c(g)):"number"==typeof d?a[d]:null};c.playerById=function(b){for(var c=0;c<a.length;c++)if(a[c].id==b)return a[c];return null};c.addPlayer=function(b){for(var c=0;c<a.length;c++)if(a[c]==b)return b;a.push(b);return b};c.destroyPlayer=function(d){for(var c=-1,e,f=0;f<a.length;f++)a[f].id==d&&(c=f,e=a[f]);0<=c&&(d=e.id,f=b.getElementById(d+("flash"==e.renderingMode?"_wrapper":"")),l.clearCss&&l.clearCss("#"+d),f&&("html5"==e.renderingMode&&e.destroyPlayer(), | ||
| 73 | +e=b.createElement("div"),e.id=d,f.parentNode.replaceChild(e,f)),a.splice(c,1));return null};f.playerReady=function(a){var b=f.api.playerById(a.id);b?b.playerReady(a):f.api.selectPlayer(a.id).playerReady(a)}}(jwplayer),function(f){var a=f.events,l=f.utils,e=a.state;f.api.instream=function(f,b,c,d){function g(a,b){k[a]||(k[a]=[],n.jwInstreamAddEventListener(a,'function(dat) { jwplayer("'+m.id+'").dispatchInstreamEvent("'+a+'", dat); }'));k[a].push(b);return this}function q(b,c){h[b]||(h[b]=[],g(a.JWPLAYER_PLAYER_STATE, | ||
| 74 | +function(a){var c=a.newstate,d=a.oldstate;if(c==b){var e=h[c];if(e)for(var f=0;f<e.length;f++)"function"==typeof e[f]&&e[f].call(this,{oldstate:d,newstate:c,type:a.type})}}));h[b].push(c);return this}var m=f,n=b,k={},h={};this.dispatchEvent=function(a,b){if(k[a])for(var c=l.translateEventResponse(a,b[1]),d=0;d<k[a].length;d++)"function"==typeof k[a][d]&&k[a][d].call(this,c)};this.onError=function(b){return g(a.JWPLAYER_ERROR,b)};this.onFullscreen=function(b){return g(a.JWPLAYER_FULLSCREEN,b)};this.onMeta= | ||
| 75 | +function(b){return g(a.JWPLAYER_MEDIA_META,b)};this.onMute=function(b){return g(a.JWPLAYER_MEDIA_MUTE,b)};this.onComplete=function(b){return g(a.JWPLAYER_MEDIA_COMPLETE,b)};this.onTime=function(b){return g(a.JWPLAYER_MEDIA_TIME,b)};this.onBuffer=function(a){return q(e.BUFFERING,a)};this.onPause=function(a){return q(e.PAUSED,a)};this.onPlay=function(a){return q(e.PLAYING,a)};this.onIdle=function(a){return q(e.IDLE,a)};this.onClick=function(b){return g(a.JWPLAYER_INSTREAM_CLICK,b)};this.onInstreamDestroyed= | ||
| 76 | +function(b){return g(a.JWPLAYER_INSTREAM_DESTROYED,b)};this.play=function(a){n.jwInstreamPlay(a)};this.pause=function(a){n.jwInstreamPause(a)};this.destroy=function(){n.jwInstreamDestroy()};m.callInternal("jwLoadInstream",c,d?d:{})}}(jwplayer),function(f){var a=f.api,l=a.selectPlayer;a.selectPlayer=function(a){return(a=l(a))?a:{registerPlugin:function(a,b,c){f.plugins.registerPlugin(a,b,c)}}}}(jwplayer)); |
trunk/research/players/js/srs.js
0 → 100755
| 1 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 2 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 3 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 4 | +/** | ||
| 5 | +* padding the output. | ||
| 6 | +* padding(3, 5, '0') is 00003 | ||
| 7 | +* padding(3, 5, 'x') is xxxx3 | ||
| 8 | +* @see http://blog.csdn.net/win_lin/article/details/12065413 | ||
| 9 | +*/ | ||
| 10 | +function padding(number, length, prefix) { | ||
| 11 | + if(String(number).length >= length){ | ||
| 12 | + return String(number); | ||
| 13 | + } | ||
| 14 | + return padding(prefix+number, length, prefix); | ||
| 15 | +} | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | +* update the navigator, add same query string. | ||
| 19 | +*/ | ||
| 20 | +function update_nav() { | ||
| 21 | + $("#nav_srs_player").attr("href", "srs_player.html" + window.location.search); | ||
| 22 | + $("#nav_srs_publisher").attr("href", "srs_publisher.html" + window.location.search); | ||
| 23 | + $("#nav_srs_bwt").attr("href", "srs_bwt.html" + window.location.search); | ||
| 24 | + $("#nav_jwplayer6").attr("href", "jwplayer6.html" + window.location.search); | ||
| 25 | + $("#nav_osmf").attr("href", "osmf.html" + window.location.search); | ||
| 26 | + $("#nav_vlc").attr("href", "vlc.html" + window.location.search); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +/** | ||
| 30 | +* parse the query string to object. | ||
| 31 | +*/ | ||
| 32 | +function parse_query_string(){ | ||
| 33 | + var obj = {}; | ||
| 34 | + | ||
| 35 | + // parse the host(hostname:http_port), pathname(dir/filename) | ||
| 36 | + obj.host = window.location.host; | ||
| 37 | + obj.hostname = window.location.hostname; | ||
| 38 | + obj.http_port = (window.location.port == "")? 80:window.location.port; | ||
| 39 | + obj.pathname = window.location.pathname; | ||
| 40 | + if (obj.pathname.lastIndexOf("/") <= 0) { | ||
| 41 | + obj.dir = "/"; | ||
| 42 | + obj.filename = ""; | ||
| 43 | + } else { | ||
| 44 | + obj.dir = obj.pathname.substr(0, obj.pathname.lastIndexOf("/")); | ||
| 45 | + obj.filename = obj.pathname.substr(obj.pathname.lastIndexOf("/")); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + // parse the query string. | ||
| 49 | + var query_string = String(window.location.search).replace(" ", "").split("?")[1]; | ||
| 50 | + if(query_string == undefined){ | ||
| 51 | + return obj; | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + var queries = query_string.split("&"); | ||
| 55 | + $(queries).each(function(){ | ||
| 56 | + var query = this.split("="); | ||
| 57 | + obj[query[0]] = query[1]; | ||
| 58 | + }); | ||
| 59 | + | ||
| 60 | + return obj; | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +/** | ||
| 64 | +@param server the ip of server. default to window.location.hostname | ||
| 65 | +@param vhost the vhost of rtmp. default to window.location.hostname | ||
| 66 | +@param port the port of rtmp. default to 1935 | ||
| 67 | +@param app the app of rtmp. default to live. | ||
| 68 | +@param stream the stream of rtmp. default to livestream. | ||
| 69 | +*/ | ||
| 70 | +function build_default_rtmp_url() { | ||
| 71 | + var query = parse_query_string(); | ||
| 72 | + | ||
| 73 | + var server = (query.server == undefined)? window.location.hostname:query.server; | ||
| 74 | + var port = (query.port == undefined)? 1935:query.port; | ||
| 75 | + var vhost = (query.vhost == undefined)? window.location.hostname:query.vhost; | ||
| 76 | + var app = (query.app == undefined)? "live":query.app; | ||
| 77 | + var stream = (query.stream == undefined)? "livestream":query.stream; | ||
| 78 | + | ||
| 79 | + if (server == vhost || vhost == "") { | ||
| 80 | + return "rtmp://" + server + ":" + port + "/" + app + "/" + stream; | ||
| 81 | + } else { | ||
| 82 | + return "rtmp://" + server + ":" + port + "/" + app + "...vhost..." + vhost + "/" + stream; | ||
| 83 | + } | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +/** | ||
| 87 | +@param server the ip of server. default to window.location.hostname | ||
| 88 | +@param vhost the vhost of hls. default to window.location.hostname | ||
| 89 | +@param hls_vhost the vhost of hls. override the server if specified. | ||
| 90 | +@param hls_port the port of hls. default to window.location.port | ||
| 91 | +@param app the app of hls. default to live. | ||
| 92 | +@param stream the stream of hls. default to livestream. | ||
| 93 | +*/ | ||
| 94 | +function build_default_hls_url() { | ||
| 95 | + var query = parse_query_string(); | ||
| 96 | + | ||
| 97 | + // for http, use hls_vhost to override server if specified. | ||
| 98 | + var server = window.location.hostname; | ||
| 99 | + if (query.server != undefined) { | ||
| 100 | + server = query.server; | ||
| 101 | + } else if (query.hls_vhost != undefined) { | ||
| 102 | + server = query.hls_vhost; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + var port = (query.hls_port == undefined)? window.location.port:query.hls_port; | ||
| 106 | + var app = (query.app == undefined)? "live":query.app; | ||
| 107 | + var stream = (query.stream == undefined)? "livestream":query.stream; | ||
| 108 | + | ||
| 109 | + if (port == "" || port == null || port == undefined) { | ||
| 110 | + port = 80; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + return "http://" + server + ":" + port + "/" + app + "/" + stream + ".m3u8"; | ||
| 114 | +} | ||
| 115 | + | ||
| 116 | +/** | ||
| 117 | +* parse the rtmp url, | ||
| 118 | +* for example: rtmp://demo.srs.com:1935/live...vhost...players/livestream | ||
| 119 | +* @return object {server, port, vhost, app, stream} | ||
| 120 | +*/ | ||
| 121 | +function srs_parse_rtmp_url(rtmp_url) { | ||
| 122 | + // @see: http://stackoverflow.com/questions/10469575/how-to-use-location-object-to-parse-url-without-redirecting-the-page-in-javascri | ||
| 123 | + var a = document.createElement("a"); | ||
| 124 | + a.href = rtmp_url.replace("rtmp://", "http://"); | ||
| 125 | + | ||
| 126 | + var vhost = a.hostname; | ||
| 127 | + var port = (a.port == "")? "1935":a.port; | ||
| 128 | + var app = a.pathname.substr(1, a.pathname.lastIndexOf("/") - 1); | ||
| 129 | + var stream = a.pathname.substr(a.pathname.lastIndexOf("/") + 1); | ||
| 130 | + | ||
| 131 | + // parse the vhost in the params of app, that srs supports. | ||
| 132 | + app = app.replace("...vhost...", "?vhost="); | ||
| 133 | + if (app.indexOf("?") >= 0) { | ||
| 134 | + var params = app.substr(app.indexOf("?")); | ||
| 135 | + app = app.substr(0, app.indexOf("?")); | ||
| 136 | + | ||
| 137 | + if (params.indexOf("vhost=") > 0) { | ||
| 138 | + vhost = params.substr(params.indexOf("vhost=") + "vhost=".length); | ||
| 139 | + if (vhost.indexOf("&") > 0) { | ||
| 140 | + vhost = vhost.substr(0, vhost.indexOf("&")); | ||
| 141 | + } | ||
| 142 | + } | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + var ret = { | ||
| 146 | + server: a.hostname, port: port, | ||
| 147 | + vhost: vhost, app: app, stream: stream | ||
| 148 | + }; | ||
| 149 | + | ||
| 150 | + return ret; | ||
| 151 | +} | ||
| 152 | + | ||
| 153 | +/** | ||
| 154 | +* player specified size. | ||
| 155 | +*/ | ||
| 156 | +function srs_get_player_modal() { return 740; } | ||
| 157 | +function srs_get_player_width() { return srs_get_player_modal() - 30; } | ||
| 158 | +function srs_get_player_height() { return srs_get_player_width() * 9 / 19; } | ||
| 159 | + | ||
| 160 | +// to query the swf anti cache. | ||
| 161 | +function srs_get_version_code() { return "1.5"; } | ||
| 162 | +// get the default vhost for players. | ||
| 163 | +function srs_get_player_vhost() { return "players"; } | ||
| 164 | +// get the stream published to vhost, | ||
| 165 | +// generally we need to transcode the stream to support HLS and filters. | ||
| 166 | +// for example, src_vhost is "players", we transcode stream to vhost "players_pub". | ||
| 167 | +// if not equals to the player vhost, return the orignal vhost. | ||
| 168 | +function srs_get_player_publish_vhost(src_vhost) { return (src_vhost != srs_get_player_vhost())? src_vhost:(src_vhost + "_pub"); } | ||
| 169 | + | ||
| 170 | +/** | ||
| 171 | +* initialize the page. | ||
| 172 | +* @param rtmp_url the div id contains the rtmp stream url to play | ||
| 173 | +* @param hls_url the div id contains the hls stream url to play | ||
| 174 | +* @param modal_player the div id contains the modal player | ||
| 175 | +*/ | ||
| 176 | +function srs_init(rtmp_url, hls_url, modal_player) { | ||
| 177 | + update_nav(); | ||
| 178 | + | ||
| 179 | + if (rtmp_url) { | ||
| 180 | + $(rtmp_url).val(build_default_rtmp_url()); | ||
| 181 | + } | ||
| 182 | + if (hls_url) { | ||
| 183 | + $(hls_url).val(build_default_hls_url()); | ||
| 184 | + } | ||
| 185 | + if (modal_player) { | ||
| 186 | + $(modal_player).width(srs_get_player_modal() + "px"); | ||
| 187 | + $(modal_player).css("margin-left", "-" + srs_get_player_modal() / 2 +"px"); | ||
| 188 | + } | ||
| 189 | +} | ||
| 190 | + | ||
| 191 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 192 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 193 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 194 | +/** | ||
| 195 | +* the SrsPlayer object. | ||
| 196 | +* @param container the html container id. | ||
| 197 | +* @param width a float value specifies the width of player. | ||
| 198 | +* @param height a float value specifies the height of player. | ||
| 199 | +*/ | ||
| 200 | +function SrsPlayer(container, width, height) { | ||
| 201 | + if (!SrsPlayer.__id) { | ||
| 202 | + SrsPlayer.__id = 100; | ||
| 203 | + } | ||
| 204 | + if (!SrsPlayer.__players) { | ||
| 205 | + SrsPlayer.__players = []; | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + SrsPlayer.__players.push(this); | ||
| 209 | + | ||
| 210 | + this.container = container; | ||
| 211 | + this.width = width; | ||
| 212 | + this.height = height; | ||
| 213 | + this.id = SrsPlayer.__id++; | ||
| 214 | + this.stream_url = null; | ||
| 215 | + this.buffer_time = 0.8; // default to 0.8 | ||
| 216 | + this.callbackObj = null; | ||
| 217 | + | ||
| 218 | + // callback set the following values. | ||
| 219 | + this.meatadata = {}; // for on_player_metadata | ||
| 220 | + this.time = 0; // current stream time. | ||
| 221 | + this.buffer_length = 0; // current stream buffer length. | ||
| 222 | +} | ||
| 223 | +/** | ||
| 224 | +* user can set some callback, then start the player. | ||
| 225 | +* callbacks: | ||
| 226 | +* on_player_ready():int, when srs player ready, user can play. | ||
| 227 | +* on_player_metadata(metadata:Object):int, when srs player get metadata. | ||
| 228 | +*/ | ||
| 229 | +SrsPlayer.prototype.start = function() { | ||
| 230 | + // embed the flash. | ||
| 231 | + var flashvars = {}; | ||
| 232 | + flashvars.id = this.id; | ||
| 233 | + flashvars.on_player_ready = "__srs_on_player_ready"; | ||
| 234 | + flashvars.on_player_metadata = "__srs_on_player_metadata"; | ||
| 235 | + flashvars.on_player_timer = "__srs_on_player_timer"; | ||
| 236 | + | ||
| 237 | + var params = {}; | ||
| 238 | + params.wmode = "opaque"; | ||
| 239 | + params.allowFullScreen = "true"; | ||
| 240 | + params.allowScriptAccess = "always"; | ||
| 241 | + | ||
| 242 | + var attributes = {}; | ||
| 243 | + | ||
| 244 | + var self = this; | ||
| 245 | + | ||
| 246 | + swfobject.embedSWF( | ||
| 247 | + "srs_player/release/srs_player.swf?_version="+srs_get_version_code(), | ||
| 248 | + this.container, | ||
| 249 | + this.width, this.height, | ||
| 250 | + "11.1", "js/AdobeFlashPlayerInstall.swf", | ||
| 251 | + flashvars, params, attributes, | ||
| 252 | + function(callbackObj){ | ||
| 253 | + self.callbackObj = callbackObj; | ||
| 254 | + } | ||
| 255 | + ); | ||
| 256 | + | ||
| 257 | + return this; | ||
| 258 | +} | ||
| 259 | +/** | ||
| 260 | +* play the stream. | ||
| 261 | +* @param stream_url the url of stream, rtmp or http. | ||
| 262 | +*/ | ||
| 263 | +SrsPlayer.prototype.play = function(url) { | ||
| 264 | + this.stream_url = url; | ||
| 265 | + this.callbackObj.ref.__play(this.stream_url, this.width, this.height, this.buffer_time); | ||
| 266 | +} | ||
| 267 | +SrsPlayer.prototype.stop = function() { | ||
| 268 | + for (var i = 0; i < SrsPlayer.__players.length; i++) { | ||
| 269 | + var player = SrsPlayer.__players[i]; | ||
| 270 | + | ||
| 271 | + if (player.id != this.id) { | ||
| 272 | + continue; | ||
| 273 | + } | ||
| 274 | + | ||
| 275 | + SrsPlayer.__players.splice(i, 1); | ||
| 276 | + break; | ||
| 277 | + } | ||
| 278 | + | ||
| 279 | + this.callbackObj.ref.__stop(); | ||
| 280 | +} | ||
| 281 | +SrsPlayer.prototype.pause = function() { | ||
| 282 | + this.callbackObj.ref.__pause(); | ||
| 283 | +} | ||
| 284 | +SrsPlayer.prototype.resume = function() { | ||
| 285 | + this.callbackObj.ref.__resume(); | ||
| 286 | +} | ||
| 287 | +/** | ||
| 288 | +* to set the DAR, for example, DAR=16:9 | ||
| 289 | +* @param num, for example, 9. | ||
| 290 | +* use metadata height if 0. | ||
| 291 | +* use user specified height if -1. | ||
| 292 | +* @param den, for example, 16. | ||
| 293 | +* use metadata width if 0. | ||
| 294 | +* use user specified width if -1. | ||
| 295 | +*/ | ||
| 296 | +SrsPlayer.prototype.dar = function(num, den) { | ||
| 297 | + this.callbackObj.ref.__dar(num, den); | ||
| 298 | +} | ||
| 299 | +/** | ||
| 300 | +* set the fullscreen size data. | ||
| 301 | +* @refer the refer fullscreen mode. it can be: | ||
| 302 | +* video: use video orignal size. | ||
| 303 | +* screen: use screen size to rescale video. | ||
| 304 | +* @param percent, the rescale percent, where | ||
| 305 | +* 100 means 100%. | ||
| 306 | +*/ | ||
| 307 | +SrsPlayer.prototype.set_fs = function(refer, percent) { | ||
| 308 | + this.callbackObj.ref.__set_fs(refer, percent); | ||
| 309 | +} | ||
| 310 | +/** | ||
| 311 | +* set the stream buffer time in seconds. | ||
| 312 | +* @buffer_time the buffer time in seconds. | ||
| 313 | +*/ | ||
| 314 | +SrsPlayer.prototype.set_bt = function(buffer_time) { | ||
| 315 | + this.buffer_time = buffer_time; | ||
| 316 | + this.callbackObj.ref.__set_bt(buffer_time); | ||
| 317 | +} | ||
| 318 | +SrsPlayer.prototype.on_player_ready = function() { | ||
| 319 | +} | ||
| 320 | +SrsPlayer.prototype.on_player_metadata = function(metadata) { | ||
| 321 | + // ignore. | ||
| 322 | +} | ||
| 323 | +SrsPlayer.prototype.on_player_timer = function(time, buffer_length) { | ||
| 324 | + // ignore. | ||
| 325 | +} | ||
| 326 | +function __srs_find_player(id) { | ||
| 327 | + for (var i = 0; i < SrsPlayer.__players.length; i++) { | ||
| 328 | + var player = SrsPlayer.__players[i]; | ||
| 329 | + | ||
| 330 | + if (player.id != id) { | ||
| 331 | + continue; | ||
| 332 | + } | ||
| 333 | + | ||
| 334 | + return player; | ||
| 335 | + } | ||
| 336 | + | ||
| 337 | + throw new Error("player not found. id=" + id); | ||
| 338 | +} | ||
| 339 | +function __srs_on_player_ready(id) { | ||
| 340 | + var player = __srs_find_player(id); | ||
| 341 | + player.on_player_ready(); | ||
| 342 | +} | ||
| 343 | +function __srs_on_player_metadata(id, metadata) { | ||
| 344 | + var player = __srs_find_player(id); | ||
| 345 | + | ||
| 346 | + // user may override the on_player_metadata, | ||
| 347 | + // so set the data before invoke it. | ||
| 348 | + player.metadata = metadata; | ||
| 349 | + | ||
| 350 | + player.on_player_metadata(metadata); | ||
| 351 | +} | ||
| 352 | +function __srs_on_player_timer(id, time, buffer_length) { | ||
| 353 | + var player = __srs_find_player(id); | ||
| 354 | + | ||
| 355 | + buffer_length = Math.max(0, buffer_length); | ||
| 356 | + buffer_length = Math.min(player.buffer_time, buffer_length); | ||
| 357 | + | ||
| 358 | + time = Math.max(0, time); | ||
| 359 | + | ||
| 360 | + // user may override the on_player_timer, | ||
| 361 | + // so set the data before invoke it. | ||
| 362 | + player.time = time; | ||
| 363 | + player.buffer_length = buffer_length; | ||
| 364 | + | ||
| 365 | + player.on_player_timer(time, buffer_length); | ||
| 366 | +} | ||
| 367 | + | ||
| 368 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 369 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 370 | +////////////////////////////////////////////////////////////////////////////////// | ||
| 371 | +/** | ||
| 372 | +* the SrsPublisher object. | ||
| 373 | +* @param container the html container id. | ||
| 374 | +* @param width a float value specifies the width of publisher. | ||
| 375 | +* @param height a float value specifies the height of publisher. | ||
| 376 | +*/ | ||
| 377 | +function SrsPublisher(container, width, height) { | ||
| 378 | + if (!SrsPublisher.__id) { | ||
| 379 | + SrsPublisher.__id = 100; | ||
| 380 | + } | ||
| 381 | + if (!SrsPublisher.__publishers) { | ||
| 382 | + SrsPublisher.__publishers = []; | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + SrsPublisher.__publishers.push(this); | ||
| 386 | + | ||
| 387 | + this.container = container; | ||
| 388 | + this.width = width; | ||
| 389 | + this.height = height; | ||
| 390 | + this.id = SrsPublisher.__id++; | ||
| 391 | + this.callbackObj = null; | ||
| 392 | + | ||
| 393 | + // set the values when publish. | ||
| 394 | + this.url = null; | ||
| 395 | + this.vcodec = {}; | ||
| 396 | + this.acodec = {}; | ||
| 397 | + | ||
| 398 | + // callback set the following values. | ||
| 399 | + this.cameras = []; | ||
| 400 | + this.microphones = []; | ||
| 401 | + this.code = 0; | ||
| 402 | + | ||
| 403 | + // error code defines. | ||
| 404 | + this.errors = { | ||
| 405 | + "100": "无法获取指定的摄像头", //error_camera_get | ||
| 406 | + "101": "无法获取指定的麦克风", //error_microphone_get | ||
| 407 | + "102": "摄像头为禁用状态,推流时请允许flash访问摄像头", //error_camera_muted | ||
| 408 | + }; | ||
| 409 | +} | ||
| 410 | +/** | ||
| 411 | +* user can set some callback, then start the publisher. | ||
| 412 | +* callbacks: | ||
| 413 | +* on_publisher_ready(cameras, microphones):int, when srs publisher ready, user can publish. | ||
| 414 | +* on_publisher_error(code, desc):int, when srs publisher error, callback this method. | ||
| 415 | +* on_publisher_warn(code, desc):int, when srs publisher warn, callback this method. | ||
| 416 | +*/ | ||
| 417 | +SrsPublisher.prototype.start = function() { | ||
| 418 | + // embed the flash. | ||
| 419 | + var flashvars = {}; | ||
| 420 | + flashvars.id = this.id; | ||
| 421 | + flashvars.on_publisher_ready = "__srs_on_publisher_ready"; | ||
| 422 | + flashvars.on_publisher_error = "__srs_on_publisher_error"; | ||
| 423 | + flashvars.on_publisher_warn = "__srs_on_publisher_warn"; | ||
| 424 | + | ||
| 425 | + var params = {}; | ||
| 426 | + params.wmode = "opaque"; | ||
| 427 | + params.allowFullScreen = "true"; | ||
| 428 | + params.allowScriptAccess = "always"; | ||
| 429 | + | ||
| 430 | + var attributes = {}; | ||
| 431 | + | ||
| 432 | + var self = this; | ||
| 433 | + | ||
| 434 | + swfobject.embedSWF( | ||
| 435 | + "srs_publisher/release/srs_publisher.swf?_version="+srs_get_version_code(), | ||
| 436 | + this.container, | ||
| 437 | + this.width, this.height, | ||
| 438 | + "11.1", "js/AdobeFlashPlayerInstall.swf", | ||
| 439 | + flashvars, params, attributes, | ||
| 440 | + function(callbackObj){ | ||
| 441 | + self.callbackObj = callbackObj; | ||
| 442 | + } | ||
| 443 | + ); | ||
| 444 | + | ||
| 445 | + return this; | ||
| 446 | +} | ||
| 447 | +/** | ||
| 448 | +* publish stream to server. | ||
| 449 | +* @param url a string indicates the rtmp url to publish. | ||
| 450 | +* @param vcodec an object contains the video codec info. | ||
| 451 | +* @param acodec an object contains the audio codec info. | ||
| 452 | +*/ | ||
| 453 | +SrsPublisher.prototype.publish = function(url, vcodec, acodec) { | ||
| 454 | + this.url = url; | ||
| 455 | + this.vcodec = vcodec; | ||
| 456 | + this.acodec = acodec; | ||
| 457 | + | ||
| 458 | + this.callbackObj.ref.__publish(url, this.width, this.height, vcodec, acodec); | ||
| 459 | +} | ||
| 460 | +SrsPublisher.prototype.stop = function() { | ||
| 461 | + this.callbackObj.ref.__stop(); | ||
| 462 | +} | ||
| 463 | +/** | ||
| 464 | +* when publisher ready. | ||
| 465 | +* @param cameras a string array contains the names of cameras. | ||
| 466 | +* @param microphones a string array contains the names of microphones. | ||
| 467 | +*/ | ||
| 468 | +SrsPublisher.prototype.on_publisher_ready = function(cameras, microphones) { | ||
| 469 | +} | ||
| 470 | +/** | ||
| 471 | +* when publisher error. | ||
| 472 | +* @code the error code. | ||
| 473 | +* @desc the error desc message. | ||
| 474 | +*/ | ||
| 475 | +SrsPublisher.prototype.on_publisher_error = function(code, desc) { | ||
| 476 | + throw new Error("publisher error. code=" + code + ", desc=" + desc); | ||
| 477 | +} | ||
| 478 | +SrsPublisher.prototype.on_publisher_warn = function(code, desc) { | ||
| 479 | + throw new Error("publisher warn. code=" + code + ", desc=" + desc); | ||
| 480 | +} | ||
| 481 | +function __srs_find_publisher(id) { | ||
| 482 | + for (var i = 0; i < SrsPublisher.__publishers.length; i++) { | ||
| 483 | + var publisher = SrsPublisher.__publishers[i]; | ||
| 484 | + | ||
| 485 | + if (publisher.id != id) { | ||
| 486 | + continue; | ||
| 487 | + } | ||
| 488 | + | ||
| 489 | + return publisher; | ||
| 490 | + } | ||
| 491 | + | ||
| 492 | + throw new Error("publisher not found. id=" + id); | ||
| 493 | +} | ||
| 494 | +function __srs_on_publisher_ready(id, cameras, microphones) { | ||
| 495 | + var publisher = __srs_find_publisher(id); | ||
| 496 | + | ||
| 497 | + publisher.cameras = cameras; | ||
| 498 | + publisher.microphones = microphones; | ||
| 499 | + | ||
| 500 | + publisher.on_publisher_ready(cameras, microphones); | ||
| 501 | +} | ||
| 502 | +function __srs_on_publisher_error(id, code) { | ||
| 503 | + var publisher = __srs_find_publisher(id); | ||
| 504 | + | ||
| 505 | + publisher.code = code; | ||
| 506 | + | ||
| 507 | + publisher.on_publisher_error(code, publisher.errors[""+code]); | ||
| 508 | +} | ||
| 509 | +function __srs_on_publisher_warn(id, code) { | ||
| 510 | + var publisher = __srs_find_publisher(id); | ||
| 511 | + | ||
| 512 | + publisher.code = code; | ||
| 513 | + | ||
| 514 | + publisher.on_publisher_warn(code, publisher.errors[""+code]); | ||
| 515 | +} | ||
| 516 | + |
| 1 | -<head> | ||
| 2 | - <title>JWPlayer5</title> | ||
| 3 | - <meta http-equiv=Content-Type content="text/html;charset=utf-8"> | ||
| 4 | - <style> | ||
| 5 | - body{margin:0; padding:0; color:#EEEEEE;} | ||
| 6 | - input.url{width:400px; height:20px;} | ||
| 7 | - input.size{width:40px; height:20px;} | ||
| 8 | - input.buffer{width:20px; height:20px;} | ||
| 9 | - input.play{width:60px; height: 25px;} | ||
| 10 | - select.type{width:50px; } | ||
| 11 | - span.size{padding-left:10px; padding-right:10px;} | ||
| 12 | - div.main{font-size:12px; padding:5px 10px 0px 5px; background-color:#333333; width: 780px;} | ||
| 13 | - div.player{padding-top:3px; padding-bottom:10px;} | ||
| 14 | - div.control{padding-bottom:10px; background-color:#333333; margin-top:5px;} | ||
| 15 | - </style> | ||
| 16 | -</head> | ||
| 17 | -<div class="main"> | ||
| 18 | - <div id="player"></div> | ||
| 19 | - <div class="control" id="control"> | ||
| 20 | - Url(RTMP/HTTP): <input id="url" type="text" class="url" value="rtmp://demo:1935/live/livestream"></input> | ||
| 21 | - <input type="button" class="play" value="Play" onclick="play()"></input> | ||
| 22 | - </div> | ||
| 23 | -</div> | ||
| 24 | -<script type="text/javascript" src="jwplayer.js" ></script> | ||
| 25 | -<script>jwplayer.key="L1P3Ig76mGOK94gZ9WAAGD+Fb1VCVhoZ/Dm0fg=="</script> | ||
| 26 | -<script type='text/javascript'> | ||
| 27 | - function play(){ | ||
| 28 | - var player = document.getElementById("player"); | ||
| 29 | - player.innerHTML = ""; | ||
| 30 | - | ||
| 31 | - var div = document.createElement("div"); | ||
| 32 | - div.id = "player_div"; | ||
| 33 | - player.appendChild(div); | ||
| 34 | - | ||
| 35 | - var url = document.getElementById("url").value; | ||
| 36 | - var provider = (url.indexOf("rtmp://") == 0) ? "rtmp":"http"; | ||
| 37 | - var conf = { | ||
| 38 | - file: url.substr(url.lastIndexOf("/") + 1), | ||
| 39 | - streamer: url.substr(0, url.lastIndexOf("/")), | ||
| 40 | - provider: 'rtmp', | ||
| 41 | - width: "720", | ||
| 42 | - height: "576", | ||
| 43 | - autostart: true, | ||
| 44 | - }; | ||
| 45 | - //console.log(conf); | ||
| 46 | - jwplayer('player_div').setup(conf); | ||
| 47 | - } | ||
| 48 | - play(); | ||
| 49 | -</script> | ||
| 50 | - |
此 diff 太大无法显示。
不能预览此文件类型
trunk/research/players/jwplayer6.html
0 → 100755
| 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.js"></script> | ||
| 10 | + <style> | ||
| 11 | + body{ | ||
| 12 | + padding-top: 55px; | ||
| 13 | + } | ||
| 14 | + #main_modal { | ||
| 15 | + width: 700px; | ||
| 16 | + margin-left: -350px; | ||
| 17 | + } | ||
| 18 | + </style> | ||
| 19 | + <script type="text/javascript" src="js/jwplayer.js" ></script> | ||
| 20 | + <script type='text/javascript'>jwplayer.key = 'N8zhkmYvvRwOhz4aTGkySoEri4x+9pQwR7GHIQ=='; </script> | ||
| 21 | + <script type="text/javascript"> | ||
| 22 | + var _player = null; | ||
| 23 | + var _url = null; | ||
| 24 | + $(function(){ | ||
| 25 | + // get the vhost and port to set the default url. | ||
| 26 | + // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo | ||
| 27 | + // url set to: rtmp://demo:1935/live/livestream | ||
| 28 | + srs_init("#txt_rtmp_url", "#txt_hls_url", "#main_modal"); | ||
| 29 | + | ||
| 30 | + $("#main_modal").on("hide", function(){ | ||
| 31 | + $("#div_container").remove(); | ||
| 32 | + _player.stop(); | ||
| 33 | + }); | ||
| 34 | + | ||
| 35 | + $("#main_modal").on("show", function(){ | ||
| 36 | + $("#div_container").remove(); | ||
| 37 | + | ||
| 38 | + var div_container = $("<div/>"); | ||
| 39 | + $(div_container).attr("id", "div_container"); | ||
| 40 | + $("#player").append(div_container); | ||
| 41 | + | ||
| 42 | + var player = $("<div/>"); | ||
| 43 | + $(player).attr("id", "player_id"); | ||
| 44 | + $(div_container).append(player); | ||
| 45 | + | ||
| 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 | + | ||
| 56 | + $("#btn_play_rtmp").click(function(){ | ||
| 57 | + _url = $("#txt_rtmp_url").val(); | ||
| 58 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 59 | + }); | ||
| 60 | + | ||
| 61 | + $("#btn_play_hls").click(function(){ | ||
| 62 | + _url = $("#txt_hls_url").val(); | ||
| 63 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 64 | + }); | ||
| 65 | + | ||
| 66 | + var query = parse_query_string(); | ||
| 67 | + if (query.hls_autostart == "true") { | ||
| 68 | + _url = $("#txt_hls_url").val(); | ||
| 69 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 70 | + } else if (query.rtmp_autostart == "true") { | ||
| 71 | + _url = $("#txt_rtmp_url").val(); | ||
| 72 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 73 | + } | ||
| 74 | + }); | ||
| 75 | + </script> | ||
| 76 | +</head> | ||
| 77 | +<body> | ||
| 78 | +<div class="navbar navbar-fixed-top"> | ||
| 79 | + <div class="navbar-inner"> | ||
| 80 | + <div class="container"> | ||
| 81 | + <a class="brand" href="index.html">SRS</a> | ||
| 82 | + <div class="nav-collapse collapse"> | ||
| 83 | + <ul class="nav"> | ||
| 84 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 85 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 86 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 87 | + <li class="active"><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 88 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 89 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 90 | + </ul> | ||
| 91 | + </div> | ||
| 92 | + </div> | ||
| 93 | + </div> | ||
| 94 | +</div> | ||
| 95 | +<div class="container"> | ||
| 96 | + <div class="alert alert-info fade in"> | ||
| 97 | + <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 98 | + <strong><span>Usage:</span></strong> <span>输入地址后点击播放按钮</span> | ||
| 99 | + </div> | ||
| 100 | + <div class="form-inline"> | ||
| 101 | + URL: | ||
| 102 | + <input type="text" id="txt_rtmp_url" class="input-xxlarge" value=""></input> | ||
| 103 | + <button class="btn btn-primary" id="btn_play_rtmp">播放RTMP</button> | ||
| 104 | + </div> | ||
| 105 | + <hr/> | ||
| 106 | + <div class="form-inline"> | ||
| 107 | + URL: | ||
| 108 | + <input type="text" id="txt_hls_url" class="input-xxlarge" value=""></input> | ||
| 109 | + <button class="btn btn-primary" id="btn_play_hls"> 播放HLS </button> | ||
| 110 | + </div> | ||
| 111 | + <div id="main_modal" class="modal hide fade"> | ||
| 112 | + <div class="modal-header"> | ||
| 113 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 114 | + <h3>JWPlayer6</h3> | ||
| 115 | + </div> | ||
| 116 | + <div class="modal-body" id="player"> | ||
| 117 | + </div> | ||
| 118 | + <div class="modal-footer"> | ||
| 119 | + <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"> 关闭 </button> | ||
| 120 | + </div> | ||
| 121 | + </div> | ||
| 122 | + <hr> | ||
| 123 | + <footer> | ||
| 124 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 125 | + </footer> | ||
| 126 | +</div> | ||
| 127 | +</body> | ||
| 128 | + |
| 1 | -<head> | ||
| 2 | - <title>JWPlayer6</title> | ||
| 3 | - <meta http-equiv=Content-Type content="text/html;charset=utf-8"> | ||
| 4 | - <style> | ||
| 5 | - body{margin:0; padding:0; color:#EEEEEE;} | ||
| 6 | - input.url{width:400px; height:20px;} | ||
| 7 | - input.size{width:40px; height:20px;} | ||
| 8 | - input.buffer{width:20px; height:20px;} | ||
| 9 | - input.play{width:60px; height: 25px;} | ||
| 10 | - select.type{width:50px; } | ||
| 11 | - span.size{padding-left:10px; padding-right:10px;} | ||
| 12 | - div.main{font-size:12px; padding:5px 10px 0px 5px; background-color:#333333; width: 780px;} | ||
| 13 | - div.player{padding-top:3px; padding-bottom:10px;} | ||
| 14 | - div.control{padding-bottom:10px; background-color:#333333; margin-top:5px;} | ||
| 15 | - </style> | ||
| 16 | -</head> | ||
| 17 | -<div class="main"> | ||
| 18 | - <div id="player"></div> | ||
| 19 | - <div class="control" id="control"> | ||
| 20 | - Url(RTMP/HTTP): <input id="url" type="text" class="url" value="rtmp://demo:1935/live/livestream"></input> | ||
| 21 | - <input type="button" class="play" value="Play" onclick="play()"></input> | ||
| 22 | - </div> | ||
| 23 | -</div> | ||
| 24 | -<script type="text/javascript" src="jwplayer.js" ></script> | ||
| 25 | -<script>jwplayer.key="L1P3Ig76mGOK94gZ9WAAGD+Fb1VCVhoZ/Dm0fg=="</script> | ||
| 26 | -<script type='text/javascript'> | ||
| 27 | - function play(){ | ||
| 28 | - var player = document.getElementById("player"); | ||
| 29 | - player.innerHTML = ""; | ||
| 30 | - | ||
| 31 | - var div = document.createElement("div"); | ||
| 32 | - div.id = "player_div"; | ||
| 33 | - player.appendChild(div); | ||
| 34 | - | ||
| 35 | - var url = document.getElementById("url").value; | ||
| 36 | - var conf = { | ||
| 37 | - file: url, | ||
| 38 | - width: "720", | ||
| 39 | - height: "576", | ||
| 40 | - autostart: true, | ||
| 41 | - }; | ||
| 42 | - //console.log(conf); | ||
| 43 | - jwplayer('player_div').setup(conf); | ||
| 44 | - } | ||
| 45 | - play(); | ||
| 46 | -</script> | ||
| 47 | - |
不能预览此文件类型
此 diff 太大无法显示。
| 1 | -if(typeof jwplayer=="undefined"){jwplayer=function(a){if(jwplayer.api){return jwplayer.api.selectPlayer(a)}};jwplayer.version="6.1.2972";jwplayer.vid=document.createElement("video");jwplayer.audio=document.createElement("audio");jwplayer.source=document.createElement("source");(function(d){var j=document,g=window,b=navigator,h="undefined",f="string",c="object";var k=d.utils=function(){};k.exists=function(m){switch(typeof(m)){case f:return(m.length>0);break;case c:return(m!==null);case h:return false}return true};k.styleDimension=function(m){return m+(m.toString().indexOf("%")>0?"":"px")};k.getAbsolutePath=function(s,r){if(!k.exists(r)){r=j.location.href}if(!k.exists(s)){return undefined}if(a(s)){return s}var t=r.substring(0,r.indexOf("://")+3);var q=r.substring(t.length,r.indexOf("/",t.length+1));var n;if(s.indexOf("/")===0){n=s.split("/")}else{var o=r.split("?")[0];o=o.substring(t.length+q.length+1,o.lastIndexOf("/"));n=o.split("/").concat(s.split("/"))}var m=[];for(var p=0;p<n.length;p++){if(!n[p]||!k.exists(n[p])||n[p]=="."){continue}else{if(n[p]==".."){m.pop()}else{m.push(n[p])}}}return t+q+"/"+m.join("/")};function a(n){if(!k.exists(n)){return}var o=n.indexOf("://");var m=n.indexOf("?");return(o>0&&(m<0||(m>o)))}k.extend=function(){var m=k.extend["arguments"];if(m.length>1){for(var o=1;o<m.length;o++){for(var n in m[o]){try{if(k.exists(m[o][n])){m[0][n]=m[o][n]}}catch(p){}}}return m[0]}return null};k.log=function(n,m){if(typeof console!=h&&typeof console.log!=h){if(m){console.log(n,m)}else{console.log(n)}}};var e=k.userAgentMatch=function(n){var m=b.userAgent.toLowerCase();return(m.match(n)!==null)};function l(m){return function(){return e(m)}}k.isIE=l(/msie/i);k.isFF=l(/firefox/i);k.isChrome=l(/chrome/i);k.isIOS=l(/iP(hone|ad|od)/i);k.isIPod=l(/iP(hone|od)/i);k.isIPad=l(/iPad/i);k.isAndroid=function(m){if(m){return e(new RegExp("android.*"+m,"i"))}else{return e(/android/i)}};k.isMobile=function(){return k.isIOS()||k.isAndroid()};k.saveCookie=function(m,n){j.cookie="jwplayer."+m+"="+n+"; path=/"};k.getCookies=function(){var p={};var o=j.cookie.split("; ");for(var n=0;n<o.length;n++){var m=o[n].split("=");if(m[0].indexOf("jwplayer.")==0){p[m[0].substring(9,m[0].length)]=m[1]}}return p};k.typeOf=function(n){var m=typeof n;if(m==="object"){if(!n){return"null"}return(n instanceof Array)?"array":m}else{return m}};k.translateEventResponse=function(o,m){var q=k.extend({},m);if(o==d.events.JWPLAYER_FULLSCREEN&&!q.fullscreen){q.fullscreen=q.message=="true"?true:false;delete q.message}else{if(typeof q.data==c){q=k.extend(q,q.data);delete q.data}else{if(typeof q.metadata==c){k.deepReplaceKeyName(q.metadata,["__dot__","__spc__","__dsh__"],["."," ","-"])}}}var n=["position","duration","offset"];for(var p in n){if(q[n[p]]){q[n[p]]=Math.round(q[n[p]]*1000)/1000}}return q};k.flashVersion=function(){if(k.isAndroid()){return 0}var m=b.plugins,n;if(m!=h){n=m["Shockwave Flash"];if(n){return parseInt(n.description.replace(/\D+(\d+)\..*/,"$1"))}}if(typeof g.ActiveXObject!=h){try{n=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");if(n){return parseInt(n.GetVariable("$version").split(" ")[1].split(",")[0])}}catch(o){}}return 0};k.getScriptPath=function(o){var m=j.getElementsByTagName("script");for(var n=0;n<m.length;n++){var p=m[n].src;if(p&&p.indexOf(o)>=0){return p.substr(0,p.indexOf(o))}}return""};k.deepReplaceKeyName=function(t,o,m){switch(d.utils.typeOf(t)){case"array":for(var q=0;q<t.length;q++){t[q]=d.utils.deepReplaceKeyName(t[q],o,m)}break;case c:for(var p in t){var s,r;if(o instanceof Array&&m instanceof Array){if(o.length!=m.length){continue}else{s=o;r=m}}else{s=[o];r=[m]}var n=p;for(var q=0;q<s.length;q++){n=n.replace(new RegExp(o[q],"g"),m[q])}t[n]=d.utils.deepReplaceKeyName(t[p],o,m);if(p!=n){delete t[p]}}break}return t};var i=k.pluginPathType={ABSOLUTE:0,RELATIVE:1,CDN:2};k.getPluginPathType=function(n){if(typeof n!=f){return}n=n.split("?")[0];var o=n.indexOf("://");if(o>0){return i.ABSOLUTE}var m=n.indexOf("/");var p=k.extension(n);if(o<0&&m<0&&(!p||!isNaN(p))){return i.CDN}return i.RELATIVE};k.getPluginName=function(m){return m.replace(/^(.*\/)?([^-]*)-?.*\.(swf|js)$/,"$2")};k.getPluginVersion=function(m){return m.replace(/[^-]*-?([^\.]*).*$/,"$1")};k.isYouTube=function(m){return(m.indexOf("youtube.com")>-1||m.indexOf("youtu.be")>-1)};k.isRtmp=function(m,n){return(m.indexOf("rtmp")==0||n=="rtmp")};k.foreach=function(o,n){for(var m in o){if(o.hasOwnProperty(m)){n(m)}}};k.isHTTPS=function(){return(g.location.href.indexOf("https")==0)}})(jwplayer);(function(o){var d="video/",i="audio/",g="image",j="mp4",c="webm",n="ogg",b="aac",k="mp3",l="vorbis",m={mp4:d+j,vorbis:i+n,ogg:d+n,webm:d+c,aac:i+j,mp3:i+"mpeg",hls:"application/vnd.apple.mpegurl"},h={mp4:m[j],f4v:m[j],m4v:m[j],mov:m[j],m4a:m[b],f4a:m[b],aac:m[b],mp3:m[k],ogv:m[n],ogg:m[l],oga:m[l],webm:m[c],m3u8:m.hls},d="video",f={flv:d,f4v:d,mov:d,m4a:d,m4v:d,mp4:d,aac:d,f4a:d,mp3:"sound",smil:"rtmp",m3u8:"hls"};var a=o.extensionmap={};for(var e in h){a[e]={html5:h[e]}}for(e in f){if(!a[e]){a[e]={}}a[e].flash=f[e]}a.types=m;a.mimeType=function(q){for(var p in m){if(m[p]==q){return p}}};a.extType=function(p){return a.mimeType(h[p])}})(jwplayer.utils);(function(b){var a=b.loaderstatus={NEW:0,LOADING:1,ERROR:2,COMPLETE:3},c=document;b.scriptloader=function(e){var f=a.NEW,h=jwplayer.events,d=new h.eventdispatcher();b.extend(this,d);this.load=function(){var k=b.scriptloader.loaders[e];if(k&&(k.getStatus()==a.NEW||k.getStatus()==a.LOADING)){k.addEventListener(h.ERROR,g);k.addEventListener(h.COMPLETE,i);return}b.scriptloader.loaders[e]=this;if(f==a.NEW){f=a.LOADING;var j=c.createElement("script");if(j.addEventListener){j.onload=i;j.onerror=g}else{if(j.readyState){j.onreadystatechange=function(){if(j.readyState=="loaded"||j.readyState=="complete"){i()}}}}c.getElementsByTagName("head")[0].appendChild(j);j.src=e}};function g(j){f=a.ERROR;d.sendEvent(h.ERROR)}function i(j){f=a.COMPLETE;d.sendEvent(h.COMPLETE)}this.getStatus=function(){return f}};b.scriptloader.loaders={}})(jwplayer.utils);(function(a){a.trim=function(b){return b.replace(/^\s*/,"").replace(/\s*$/,"")};a.pad=function(c,d,b){if(!b){b="0"}while(c.length<d){c=b+c}return c};a.xmlAttribute=function(b,c){for(var d=0;d<b.attributes.length;d++){if(b.attributes[d].name&&b.attributes[d].name.toLowerCase()==c.toLowerCase()){return b.attributes[d].value.toString()}}return""};a.extension=function(b){if(!b||b.substr(0,4)=="rtmp"){return""}b=b.substring(b.lastIndexOf("/")+1,b.length).split("?")[0].split("#")[0];if(b.lastIndexOf(".")>-1){return b.substr(b.lastIndexOf(".")+1,b.length).toLowerCase()}};a.stringToColor=function(b){b=b.replace(/(#|0x)?([0-9A-F]{3,6})$/gi,"$2");if(b.length==3){b=b.charAt(0)+b.charAt(0)+b.charAt(1)+b.charAt(1)+b.charAt(2)+b.charAt(2)}return parseInt(b,16)}})(jwplayer.utils);(function(a){var c="invalid",b="36QXq4W@GSBV^teR";a.key=function(h){var g,i,e;function f(j){if(!a.exists(j)){j=""}try{j=d(j);var l=j.split("/");g=l[0];if(!g){g="free"}else{if(a.key.valid.indexOf(g)<0){g=c}}i=l[1];if(l[2]&&parseInt(l[2])>0){e=new Date();e.setTime(String(l[2]))}}catch(k){g=c}}function d(j){return a.tea.decrypt(j,b)}this.edition=function(){if(e&&e.getTime()<(new Date()).getTime()){return c}return g};this.token=function(){return i};f(h)};a.key.valid=["free","pro"]})(jwplayer.utils);(function(b){var c=b.tea={};c.encrypt=function(h,w){if(h.length==0){return("")}var x=c.strToLongs(a.encode(h));if(x.length<=1){x[1]=0}var l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=0;while(f-->0){m+=u;o=m>>>2&3;for(var g=0;g<i;g++){s=x[(g+1)%i];t=(r>>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[g&3^o]^r);r=x[g]+=t}}var j=c.longsToStr(x);return d.encode(j)};c.decrypt=function(j,w){if(j.length==0){return("")}var x=c.strToLongs(d.decode(j)),l=c.strToLongs(a.encode(w).slice(0,16)),i=x.length,r=x[i-1],s=x[0],u=2654435769,t,o,f=Math.floor(6+52/i),m=f*u;while(m!=0){o=m>>>2&3;for(var h=i-1;h>=0;h--){r=x[h>0?h-1:i-1];t=(r>>>5^s<<2)+(s>>>3^r<<4)^(m^s)+(l[h&3^o]^r);s=x[h]-=t}m-=u}var g=c.longsToStr(x);g=g.replace(/\0+$/,"");return a.decode(g)};c.strToLongs=function(g){var e=new Array(Math.ceil(g.length/4));for(var f=0;f<e.length;f++){e[f]=g.charCodeAt(f*4)+(g.charCodeAt(f*4+1)<<8)+(g.charCodeAt(f*4+2)<<16)+(g.charCodeAt(f*4+3)<<24)}return e};c.longsToStr=function(f){var e=new Array(f.length);for(var g=0;g<f.length;g++){e[g]=String.fromCharCode(f[g]&255,f[g]>>>8&255,f[g]>>>16&255,f[g]>>>24&255)}return e.join("")};var d={};d.code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";d.encode=function(q,s){s=(typeof s=="undefined")?false:s;var j,g,f,u,r,n,m,k,l=[],i="",p,t,o;var h=d.code;t=s?a.encode(q):q;p=t.length%3;if(p>0){while(p++<3){i+="=";t+="\0"}}for(p=0;p<t.length;p+=3){j=t.charCodeAt(p);g=t.charCodeAt(p+1);f=t.charCodeAt(p+2);u=j<<16|g<<8|f;r=u>>18&63;n=u>>12&63;m=u>>6&63;k=u&63;l[p/3]=h.charAt(r)+h.charAt(n)+h.charAt(m)+h.charAt(k)}o=l.join("");o=o.slice(0,o.length-i.length)+i;return o};d.decode=function(p,g){g=(typeof g=="undefined")?false:g;var i,f,e,q,m,k,j,s,l=[],r,o;var h=d.code;o=g?a.decode(p):p;for(var n=0;n<o.length;n+=4){q=h.indexOf(o.charAt(n));m=h.indexOf(o.charAt(n+1));k=h.indexOf(o.charAt(n+2));j=h.indexOf(o.charAt(n+3));s=q<<18|m<<12|k<<6|j;i=s>>>16&255;f=s>>>8&255;e=s&255;l[n/4]=String.fromCharCode(i,f,e);if(j==64){l[n/4]=String.fromCharCode(i,f)}if(k==64){l[n/4]=String.fromCharCode(i)}}r=l.join("");return g?a.decode(r):r};var a={};a.encode=function(e){var f=e.replace(/[\u0080-\u07ff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(192|g>>6,128|g&63)});f=f.replace(/[\u0800-\uffff]/g,function(h){var g=h.charCodeAt(0);return String.fromCharCode(224|g>>12,128|g>>6&63,128|g&63)});return f};a.decode=function(f){var e=f.replace(/[\u00e0-\u00ef][\u0080-\u00bf][\u0080-\u00bf]/g,function(h){var g=((h.charCodeAt(0)&15)<<12)|((h.charCodeAt(1)&63)<<6)|(h.charCodeAt(2)&63);return String.fromCharCode(g)});e=e.replace(/[\u00c0-\u00df][\u0080-\u00bf]/g,function(h){var g=(h.charCodeAt(0)&31)<<6|h.charCodeAt(1)&63;return String.fromCharCode(g)});return e}})(jwplayer.utils);(function(a){a.events={COMPLETE:"COMPLETE",ERROR:"ERROR",API_READY:"jwplayerAPIReady",JWPLAYER_READY:"jwplayerReady",JWPLAYER_FULLSCREEN:"jwplayerFullscreen",JWPLAYER_RESIZE:"jwplayerResize",JWPLAYER_ERROR:"jwplayerError",JWPLAYER_MEDIA_BEFOREPLAY:"jwplayerMediaBeforePlay",JWPLAYER_MEDIA_BEFORECOMPLETE:"jwplayerMediaBeforeComplete",JWPLAYER_COMPONENT_SHOW:"jwplayerComponentShow",JWPLAYER_COMPONENT_HIDE:"jwplayerComponentHide",JWPLAYER_MEDIA_BUFFER:"jwplayerMediaBuffer",JWPLAYER_MEDIA_BUFFER_FULL:"jwplayerMediaBufferFull",JWPLAYER_MEDIA_ERROR:"jwplayerMediaError",JWPLAYER_MEDIA_LOADED:"jwplayerMediaLoaded",JWPLAYER_MEDIA_COMPLETE:"jwplayerMediaComplete",JWPLAYER_MEDIA_SEEK:"jwplayerMediaSeek",JWPLAYER_MEDIA_TIME:"jwplayerMediaTime",JWPLAYER_MEDIA_VOLUME:"jwplayerMediaVolume",JWPLAYER_MEDIA_META:"jwplayerMediaMeta",JWPLAYER_MEDIA_MUTE:"jwplayerMediaMute",JWPLAYER_MEDIA_LEVELS:"jwplayerMediaLevels",JWPLAYER_MEDIA_LEVEL_CHANGED:"jwplayerMediaLevelChanged",JWPLAYER_CAPTIONS_CHANGED:"jwplayerCaptionsChanged",JWPLAYER_CAPTIONS_LIST:"jwplayerCaptionsList",JWPLAYER_PLAYER_STATE:"jwplayerPlayerState",state:{BUFFERING:"BUFFERING",IDLE:"IDLE",PAUSED:"PAUSED",PLAYING:"PLAYING"},JWPLAYER_PLAYLIST_LOADED:"jwplayerPlaylistLoaded",JWPLAYER_PLAYLIST_ITEM:"jwplayerPlaylistItem",JWPLAYER_PLAYLIST_COMPLETE:"jwplayerPlaylistComplete",JWPLAYER_DISPLAY_CLICK:"jwplayerViewClick",JWPLAYER_CONTROLS:"jwplayerViewControls",JWPLAYER_INSTREAM_CLICK:"jwplayerInstreamClicked",JWPLAYER_INSTREAM_DESTROYED:"jwplayerInstreamDestroyed"}})(jwplayer);(function(a){var b=jwplayer.utils;a.eventdispatcher=function(h,c){var e=h,g=c,f,d;this.resetEventListeners=function(){f={};d=[]};this.resetEventListeners();this.addEventListener=function(i,l,k){try{if(!b.exists(f[i])){f[i]=[]}if(b.typeOf(l)=="string"){l=(new Function("return "+l))()}f[i].push({listener:l,count:k})}catch(j){b.log("error",j)}return false};this.removeEventListener=function(j,l){if(!f[j]){return}try{for(var i=0;i<f[j].length;i++){if(f[j][i].listener.toString()==l.toString()){f[j].splice(i,1);break}}}catch(k){b.log("error",k)}return false};this.addGlobalListener=function(k,j){try{if(b.typeOf(k)=="string"){k=(new Function("return "+k))()}d.push({listener:k,count:j})}catch(i){b.log("error",i)}return false};this.removeGlobalListener=function(k){if(!k){return}try{for(var i=0;i<d.length;i++){if(d[i].listener.toString()==k.toString()){d.splice(i,1);break}}}catch(j){b.log("error",j)}return false};this.sendEvent=function(k,m){if(!b.exists(m)){m={}}b.extend(m,{id:e,version:jwplayer.version,type:k});if(g){b.log(k,m)}if(b.typeOf(f[k])!="undefined"){for(var j=0;j<f[k].length;j++){try{f[k][j].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),f[k][j].listener)}if(f[k][j]){if(f[k][j].count===1){delete f[k][j]}else{if(f[k][j].count>0){f[k][j].count=f[k][j].count-1}}}}}var i;for(i=0;i<d.length;i++){try{d[i].listener(m)}catch(l){b.log("There was an error while handling a listener: "+l.toString(),d[i].listener)}if(d[i]){if(d[i].count===1){delete d[i]}else{if(d[i].count>0){d[i].count=d[i].count-1}}}}}}})(jwplayer.events);(function(a){var c={},b={};a.plugins=function(){};a.plugins.loadPlugins=function(e,d){b[e]=new a.plugins.pluginloader(new a.plugins.model(c),d);return b[e]};a.plugins.registerPlugin=function(h,g,f,e){var d=a.utils.getPluginName(h);if(!c[d]){c[d]=new a.plugins.plugin(h)}c[d].registerPlugin(h,g,f,e)}})(jwplayer);(function(a){a.plugins.model=function(b){this.addPlugin=function(c){var d=a.utils.getPluginName(c);if(!b[d]){b[d]=new a.plugins.plugin(c)}return b[d]};this.getPlugins=function(){return b}}})(jwplayer);(function(b){var a=jwplayer.utils,c=jwplayer.events,d="undefined";b.pluginmodes={FLASH:0,JAVASCRIPT:1,HYBRID:2};b.plugin=function(e){var l=a.loaderstatus.NEW,m,k,f,n;var g=new c.eventdispatcher();a.extend(this,g);function h(){switch(a.getPluginPathType(e)){case a.pluginPathType.ABSOLUTE:return e;case a.pluginPathType.RELATIVE:return a.getAbsolutePath(e,window.location.href)}}function j(o){n=setTimeout(function(){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)},1000)}function i(o){l=a.loaderstatus.ERROR;g.sendEvent(c.ERROR)}this.load=function(){if(l==a.loaderstatus.NEW){if(e.lastIndexOf(".swf")>0){m=e;l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}else{if(a.getPluginPathType(e)==a.pluginPathType.CDN){l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE);return}}l=a.loaderstatus.LOADING;var o=new a.scriptloader(h());o.addEventListener(c.COMPLETE,j);o.addEventListener(c.ERROR,i);o.load()}};this.registerPlugin=function(r,q,p,o){if(n){clearTimeout(n);n=undefined}f=q;if(p&&o){m=o;k=p}else{if(typeof p=="string"){m=p}else{if(typeof p=="function"){k=p}else{if(!p&&!o){m=r}}}}l=a.loaderstatus.COMPLETE;g.sendEvent(c.COMPLETE)};this.getStatus=function(){return l};this.getPluginName=function(){return a.getPluginName(e)};this.getFlashPath=function(){if(m){switch(a.getPluginPathType(m)){case a.pluginPathType.ABSOLUTE:return m;case a.pluginPathType.RELATIVE:if(e.lastIndexOf(".swf")>0){return a.getAbsolutePath(m,window.location.href)}return a.getAbsolutePath(m,h())}}return null};this.getJS=function(){return k};this.getTarget=function(){return f};this.getPluginmode=function(){if(typeof m!=d&&typeof k!=d){return b.pluginmodes.HYBRID}else{if(typeof m!=d){return b.pluginmodes.FLASH}else{if(typeof k!=d){return b.pluginmodes.JAVASCRIPT}}}};this.getNewInstance=function(p,o,q){return new k(p,o,q)};this.getURL=function(){return e}}})(jwplayer.plugins);(function(b){var a=b.utils,c=b.events;b.plugins.pluginloader=function(i,h){var o=a.loaderstatus.NEW,g=false,d=false,k=false,l,m=h,e=new c.eventdispatcher();a.extend(this,e);function f(){if(k){e.sendEvent(c.ERROR,{message:l})}else{if(!d){d=true;o=a.loaderstatus.COMPLETE;e.sendEvent(c.COMPLETE)}}}function n(){if(!m){f()}if(!d&&!k){var r=0,q=i.getPlugins();for(var s in m){var t=a.getPluginName(s),w=q[t],v=w.getJS(),u=w.getTarget(),p=w.getStatus();if(p==a.loaderstatus.LOADING||p==a.loaderstatus.NEW){r++}else{if(v&&(!u||parseFloat(u)>parseFloat(b.version))){k=true;l="Incompatible player version";f()}}}if(r==0){f()}}}this.setupPlugins=function(x,s,A){var r={length:0,plugins:{}},v={length:0,plugins:{}},u=i.getPlugins();for(var w in s.plugins){var y=a.getPluginName(w),z=u[y],B=z.getFlashPath(),C=z.getJS(),p=z.getURL();if(B){r.plugins[B]=a.extend({},s.plugins[w]);r.plugins[B].pluginmode=z.getPluginmode();r.length++}try{if(C&&s.plugins&&s.plugins[p]){var q=document.createElement("div");q.id=x.id+"_"+y;q.style.position="absolute";q.style.top=0;q.style.zIndex=v.length+10;v.plugins[y]=z.getNewInstance(x,a.extend({},s.plugins[p]),q);v.length++;x.onReady(A(v.plugins[y],q,true));x.onResize(A(v.plugins[y],q))}}catch(t){console.log("ERROR: Failed to load "+y+".")}}x.plugins=v.plugins;return r};this.load=function(){if(a.exists(h)&&a.typeOf(h)!="object"){n();return}o=a.loaderstatus.LOADING;g=true;for(var q in h){if(a.exists(q)){var r=i.addPlugin(q);r.addEventListener(c.COMPLETE,n);r.addEventListener(c.ERROR,j)}}var p=i.getPlugins();for(q in p){p[q].load()}g=false;n()};var j=this.pluginFailed=function(p){if(!k){k=true;l="File not found";f()}};this.getStatus=function(){return o}}})(jwplayer);(function(a){a.playlist=function(c){var d=[];if(a.utils.typeOf(c)=="array"){for(var b=0;b<c.length;b++){d.push(new a.playlist.item(c[b]))}}else{d.push(new a.playlist.item(c))}return d}})(jwplayer);(function(b){var a=b.item=function(d){var c=jwplayer.utils.extend({},a.defaults,d);if(c.sources.length==0){c.sources=[new b.source(c)]}for(var e=0;e<c.sources.length;e++){c.sources[e]=new b.source(c.sources[e])}return c};a.defaults={description:"",image:"",mediaid:"",title:"",tags:"",duration:-1,sources:[]}})(jwplayer.playlist);(function(d){var b=undefined,a=jwplayer.utils,c={file:b,label:b,bitrate:b,width:b,height:b,type:b};d.source=function(f){var e=a.extend({},c);for(var g in c){if(a.exists(f[g])){e[g]=f[g];delete f[g]}}if(e.type&&e.type.indexOf("/")>0){e.type=a.extensionmap.mimeType(e.type)}return e}})(jwplayer.playlist);(function(b){var a=b.utils,c=b.events,d=document;var e=b.embed=function(u){var q=new e.config(u.config),j,l,h,k=q.width,m=q.height,o="Error loading player: ",i=b.plugins.loadPlugins(u.id,q.plugins);if(q.fallbackDiv){h=q.fallbackDiv;delete q.fallbackDiv}q.id=u.id;l=d.getElementById(u.id);j=d.createElement("div");j.id=l.id;j.style.width=k.toString().indexOf("%")>0?k:(k+"px");j.style.height=m.toString().indexOf("%")>0?m:(m+"px");l.parentNode.replaceChild(j,l);function n(x,w){for(var v in w){if(typeof x[v]=="function"){(x[v]).call(x,w[v])}}}function f(){if(a.typeOf(q.playlist)=="array"&&q.playlist.length<2){if(q.playlist.length==0||!q.playlist[0].sources||q.playlist[0].sources.length==0){s();return}}if(i.getStatus()==a.loaderstatus.COMPLETE){for(var x=0;x<q.modes.length;x++){if(q.modes[x].type&&e[q.modes[x].type]){var v=a.extend({},q),w=new e[q.modes[x].type](j,q.modes[x],v,i,u);if(w.supportsConfig()){w.addEventListener(c.ERROR,g);w.embed();n(u,v.events);return u}}}if(q.fallback){a.log("No suitable players found and fallback enabled");new e.download(j,q,s)}else{a.log("No suitable players found and fallback disabled");r()}}}function r(){j.parentNode.replaceChild(h,j)}function g(v){t(j,o+v.message)}function p(v){t(j,"Could not load plugins: "+v.message)}function s(){t(j,o+"No playable sources found")}function t(v,x){if(!q.fallback){return}var w=v.style;w.backgroundColor="#000";w.color="#FFF";w.width=a.styleDimension(q.width);w.height=a.styleDimension(q.height);w.display="table";w.opacity=1;var z=document.createElement("p"),y=z.style;y.verticalAlign="middle";y.textAlign="center";y.display="table-cell";y.font="15px/20px Arial, Helvetica, sans-serif";z.innerHTML=x.replace(":",":<br>");v.innerHTML="";v.appendChild(z)}b.embed.errorScreen=t;i.addEventListener(c.COMPLETE,f);i.addEventListener(c.ERROR,p);i.load();return u}})(jwplayer);(function(d){var a=d.utils,h=d.embed,b=d.playlist.item,f=undefined;var c=h.config=function(j){var l={fallback:true,height:270,primary:"html5",width:480,base:j.base?j.base:a.getScriptPath("jwplayer.js")},k=a.extend(l,j),i={html5:{type:"html5",src:k.base+"jwplayer.html5.js"},flash:{type:"flash",src:k.base+"jwplayer.flash.swf"}};k.modes=(k.primary=="flash")?[i.flash,i.html5]:[i.html5,i.flash];if(k.listbar){k.playlistsize=k.listbar.size;k.playlistposition=k.listbar.position}e(k);return k};c.addConfig=function(i,j){e(j);return a.extend(i,j)};function e(l){if(!l.playlist){var n={};for(var k in b.defaults){g(l,n,k)}if(!n.sources){if(l.levels){n.sources=l.levels;delete l.levels}else{var j={};g(l,j,"file");g(l,j,"type");n.sources=j.file?[j]:[]}}l.playlist=[n]}else{for(var m=0;m<l.playlist.length;m++){l.playlist[m]=new b(l.playlist[m])}}}function g(k,i,j){if(a.exists(k[j])){i[j]=k[j];delete k[j]}}})(jwplayer);(function(e){var g=e.embed,j=e.utils,i=document,h="pointer",c="none",a="block",f="100%",d="relative",b="absolute";g.download=function(n,y,l){var q=j.extend({},y),u,o=q.width?q.width:480,r=q.height?q.height:320,z,s,k=y.logo?y.logo:{prefix:"http://p.jwpcdn.com/",file:"logo.png",margin:10};function x(){var E,F,D,G,C=q.playlist,J,B,G,H=["mp4","aac","mp3"];if(C&&C.length){J=C[0];B=J.sources;for(G=0;G<B.length;G++){var A=B[G],I=A.type?A.type:j.extensionmap.extType(j.extension(A.file));if(A.file){for(G in H){if(I==H[G]){E=A.file;F=J.image}else{if(j.isYouTube(A.file)){D=A.file}}}if(E||D){continue}}}}else{return}if(E){z=E;s=F;if(k.prefix){if(j.isHTTPS()){k.prefix=k.prefix.replace("http://","https://ssl.")}k.prefix+=e.version.split(/\W/).splice(0,2).join("/")}t();p()}else{if(D){m(D)}else{l()}}}function t(){if(n){u=v("a","display",n);v("div","icon",u);v("div","logo",u);if(z){u.setAttribute("href",j.getAbsolutePath(z))}}}function w(A,C){var D=i.querySelectorAll(A);for(var B=0;B<D.length;B++){for(var E in C){D[B].style[E]=C[E]}}}function p(){var A="#"+n.id+" .jwdownload";n.style.width="";n.style.height="";w(A+"display",{width:j.styleDimension(Math.max(320,o)),height:j.styleDimension(Math.max(180,r)),background:"black center no-repeat "+(s?"url("+s+")":""),backgroundSize:"contain",position:d,border:c,display:a});w(A+"display div",{position:b,width:f,height:f});w(A+"logo",{top:k.margin+"px",right:k.margin+"px",background:"top right no-repeat url("+k.prefix+k.file+")"});w(A+"icon",{background:"center no-repeat url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAgNJREFUeNrs28lqwkAYB/CZqNVDDj2r6FN41QeIy8Fe+gj6BL275Q08u9FbT8ZdwVfotSBYEPUkxFOoks4EKiJdaDuTjMn3wWBO0V/+sySR8SNSqVRKIR8qaXHkzlqS9jCfzzWcTCYp9hF5o+59sVjsiRzcegSckFzcjT+ruN80TeSlAjCAAXzdJSGPFXRpAAMYwACGZQkSdhG4WCzehMNhqV6vG6vVSrirKVEw66YoSqDb7cqlUilE8JjHd/y1MQefVzqdDmiaJpfLZWHgXMHn8F6vJ1cqlVAkEsGuAn83J4gAd2RZymQygX6/L1erVQt+9ZPWb+CDwcCC2zXGJaewl/DhcHhK3DVj+KfKZrMWvFarcYNLomAv4aPRSFZVlTlcSPA5fDweW/BoNIqFnKV53JvncjkLns/n/cLdS+92O7RYLLgsKfv9/t8XlDn4eDyiw+HA9Jyz2eyt0+kY2+3WFC5hluej0Ha7zQQq9PPwdDq1Et1sNsx/nFBgCqWJ8oAK1aUptNVqcYWewE4nahfU0YQnk4ntUEfGMIU2m01HoLaCKbTRaDgKtaVLk9tBYaBcE/6Artdr4RZ5TB6/dC+9iIe/WgAMYADDpAUJAxjAAAYwgGFZgoS/AtNNTF7Z2bL0BYPBV3Jw5xFwwWcYxgtBP5OkE8i9G7aWGOOCruvauwADALMLMEbKf4SdAAAAAElFTkSuQmCC)"})}function v(A,D,C){var B=i.createElement(A);if(D){B.className="jwdownload"+D}if(C){C.appendChild(B)}return B}function m(A){var B=v("embed","",n);B.src="http://www.youtube.com/v/"+(/v[=\/](\w*)|\/(\w+)$|^(\w+)$/i).exec(A).slice(1).join("");B.type="application/x-shockwave-flash";B.width=o;B.height=r}x()}})(jwplayer);(function(c){var b=c.utils,d=c.events,a={};var e=c.embed.flash=function(l,m,p,k,n){var h=new c.events.eventdispatcher(),i=b.flashVersion();b.extend(this,h);function q(s,r,t){var u=document.createElement("param");u.setAttribute("name",r);u.setAttribute("value",t);s.appendChild(u)}function o(s,t,r){return function(u){try{if(r){document.getElementById(n.id+"_wrapper").appendChild(t)}var w=document.getElementById(n.id).getPluginConfig("display");if(typeof s.resize=="function"){s.resize(w.width,w.height)}t.style.left=w.x;t.style.top=w.h}catch(v){}}}function j(t){if(!t){return{}}var v={};for(var s in t){var r=t[s];for(var u in r){v[s+"."+u]=r[u]}}return v}function g(u){if(!u){return{}}var x={},w=[];for(var r in u){var t=b.getPluginName(r);var s=u[r];w.push(r);for(var v in s){x[t+"."+v]=s[v]}}x.plugins=w.join(",");return x}this.embed=function(){p.id=n.id;if(i<10){h.sendEvent(d.ERROR,{message:"Flash version must be 10.0 or greater"});return false}var C;var v=b.extend({},p);if(l.id+"_wrapper"==l.parentNode.id){C=document.getElementById(l.id+"_wrapper")}else{C=document.createElement("div");C.id=l.id+"_wrapper";C.style.position="relative";C.style.width=b.styleDimension(v.width);C.style.height=b.styleDimension(v.height);l.parentNode.replaceChild(C,l);C.appendChild(l)}var t=k.setupPlugins(n,v,o);if(t.length>0){b.extend(v,g(t.plugins))}else{delete v.plugins}if(typeof v["dock.position"]!="undefined"){if(v["dock.position"].toString().toLowerCase()=="false"){v.dock=v["dock.position"];delete v["dock.position"]}}var D="#000000",y,u=v.wmode?v.wmode:(v.height&&v.height<=40?"transparent":"opaque"),w=["height","width","modes","events","primary","base","fallback","volume"];for(var z=0;z<w.length;z++){delete v[w[z]]}var B=b.getCookies();for(var s in B){if(typeof(v[s])=="undefined"){v[s]=B[s]}}var r=window.location.pathname.split("/");r.splice(r.length-1,1);r=r.join("/");v.base=r+"/";a[l.id]=v;if(b.isIE()){var A='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" " width="100%" height="100%" id="'+l.id+'" name="'+l.id+'" tabindex=0"">';A+='<param name="movie" value="'+m.src+'">';A+='<param name="allowfullscreen" value="true">';A+='<param name="allowscriptaccess" value="always">';A+='<param name="seamlesstabbing" value="true">';A+='<param name="wmode" value="'+u+'">';A+='<param name="bgcolor" value="'+D+'">';A+="</object>";l.outerHTML=A;y=document.getElementById(l.id)}else{var x=document.createElement("object");x.setAttribute("type","application/x-shockwave-flash");x.setAttribute("data",m.src);x.setAttribute("width","100%");x.setAttribute("height","100%");x.setAttribute("bgcolor",D);x.setAttribute("id",l.id);x.setAttribute("name",l.id);x.setAttribute("tabindex",0);q(x,"allowfullscreen","true");q(x,"allowscriptaccess","always");q(x,"seamlesstabbing","true");q(x,"wmode",u);l.parentNode.replaceChild(x,l);y=x}n.container=y;n.setPlayer(y,"flash")};this.supportsConfig=function(){if(i){if(p){if(b.typeOf(p.playlist)=="string"){return true}try{var t=p.playlist[0],r=t.sources;if(typeof r=="undefined"){return true}else{for(var s=0;s<r.length;s++){if(r[s].file&&f(r[s].file,r[s].type)){return true}}}}catch(u){return false}}else{return true}}return false};function f(r,s){if(b.isYouTube(r)){return true}if(b.isRtmp(r,s)){return true}if(s=="hls"){return true}var t=b.extensionmap[s?s:b.extension(r)];if(!t){return false}return !!(t.flash)}};e.getVars=function(f){return a[f]}})(jwplayer);(function(c){var a=c.utils,b=a.extensionmap,d=c.events;c.embed.html5=function(g,h,o,f,k){var j=this,e=new d.eventdispatcher();a.extend(j,e);function l(q,r,p){return function(s){try{var t=document.querySelector("#"+g.id+" .jwmain");if(p){t.appendChild(r)}if(typeof q.resize=="function"){q.resize(t.clientWidth,t.clientHeight);setTimeout(function(){q.resize(t.clientWidth,t.clientHeight)},400)}r.left=t.style.left;r.top=t.style.top}catch(u){}}}j.embed=function(){if(c.html5){f.setupPlugins(k,o,l);g.innerHTML="";var p=c.utils.extend({},o);delete p.volume;var q=new c.html5.player(p);k.container=document.getElementById(k.id);k.setPlayer(q,"html5")}else{var r=new a.scriptloader(h.src);r.addEventListener(d.ERROR,i);r.addEventListener(d.COMPLETE,j.embed);r.load()}};function i(p){j.sendEvent(p.type,{message:"HTML5 player not found"})}j.supportsConfig=function(){if(!!c.vid.canPlayType){try{if(a.typeOf(o.playlist)=="string"){return true}else{var p=o.playlist[0].sources;for(var r=0;r<p.length;r++){var q=p[r].file,s=p[r].type;if(n(q,s)){return true}}}}catch(t){return false}}return false};function n(p,q){if(navigator.userAgent.match(/BlackBerry/i)!==null){return false}if(a.isAndroid()&&(a.extension(p)=="m3u"||a.extension(p)=="m3u8")){return false}if(a.isRtmp(p,q)){return false}var r=b[q?q:a.extension(p)];if(!r){return false}if(r.flash&&!r.html5){return false}return m(r.html5)}function m(p){var q=c.vid;if(!p){return true}try{if(q.canPlayType(p)){return true}else{return false}}catch(r){return false}}}})(jwplayer);(function(c){var b=c.embed,a=c.utils,d=a.extend(function(k){var j=(a.isHTTPS()?"https://ssl.":"http://")+"p.jwpcdn.com/"+c.version.replace(/(\d+)\.(\d+).*/,"$1/$2/"),g=k.config,e=g.plugins,f=g.analytics,i=j+"jwpsrv.js",h=new c.utils.key(c.key);if(h.edition()=="ads"&&g.advertising){g.plugins[j+g.advertising.client+(g.primary=="flash"?".swf":".js")]=g.advertising}delete g.advertising;g.key=c.key;delete g.analytics;e=e?e:{};e[i]=f?f:{};g.plugins=e;return new b(k)},b);c.embed=d})(jwplayer);(function(d){var c=[],a=d.utils,e=d.events,b=e.state,g=document;var f=d.api=function(t){var x=this,h={},l={},A={},o=[],i=undefined,D=false,p=[],y=undefined,s={},n={};x.container=t;x.id=t.id;x.getBuffer=function(){return w("jwGetBuffer")};x.getContainer=function(){return x.container};x.addButton=function(H,F,G,K){try{n[K]=G;var J="jwplayer('"+x.id+"').callback('"+K+"')";w("jwDockAddButton",H,F,J,K)}catch(I){a.log("Could not add dock button"+I.message)}};x.removeButton=function(F){w("jwDockRemoveButton",F)},x.callback=function(F){if(n[F]){n[F]()}};x.getDuration=function(){return w("jwGetDuration")};x.getFullscreen=function(){return w("jwGetFullscreen")};x.getStretching=function(){return w("jwGetStretching")};x.getHeight=function(){return w("jwGetHeight")};x.getLockState=function(){return w("jwGetLockState")};x.getMeta=function(){return x.getItemMeta()};x.getMute=function(){return w("jwGetMute")};x.getPlaylist=function(){var G=w("jwGetPlaylist");if(x.renderingMode=="flash"){a.deepReplaceKeyName(G,["__dot__","__spc__","__dsh__"],["."," ","-"])}for(var F=0;F<G.length;F++){if(!a.exists(G[F].index)){G[F].index=F}}return G};x.getPlaylistItem=function(F){if(!a.exists(F)){F=x.getCurrentItem()}return x.getPlaylist()[F]};x.getPosition=function(){return w("jwGetPosition")};x.getRenderingMode=function(){return x.renderingMode};x.getState=function(){return w("jwGetState")};x.getVolume=function(){return w("jwGetVolume")};x.getWidth=function(){return w("jwGetWidth")};x.setFullscreen=function(F){if(!a.exists(F)){w("jwSetFullscreen",!w("jwGetFullscreen"))}else{w("jwSetFullscreen",F)}return x};x.setStretching=function(F){w("jwSetStretching",F);return x};x.setMute=function(F){if(!a.exists(F)){w("jwSetMute",!w("jwGetMute"))}else{w("jwSetMute",F)}return x};x.lock=function(){return x};x.unlock=function(){return x};x.load=function(F){w("jwLoad",F);return x};x.playlistItem=function(F){w("jwPlaylistItem",parseInt(F));return x};x.playlistPrev=function(){w("jwPlaylistPrev");return x};x.playlistNext=function(){w("jwPlaylistNext");return x};x.resize=function(G,F){if(x.renderingMode!="flash"){w("jwResize",G,F)}else{var H=g.getElementById(x.id+"_wrapper");if(H){H.style.width=a.styleDimension(G);H.style.height=a.styleDimension(F)}}return x};x.play=function(F){if(typeof F=="undefined"){F=x.getState();if(F==b.PLAYING||F==b.BUFFERING){w("jwPause")}else{w("jwPlay")}}else{w("jwPlay",F)}return x};x.pause=function(F){if(typeof F=="undefined"){F=x.getState();if(F==b.PLAYING||F==b.BUFFERING){w("jwPause")}else{w("jwPlay")}}else{w("jwPause",F)}return x};x.stop=function(){w("jwStop");return x};x.seek=function(F){w("jwSeek",F);return x};x.setVolume=function(F){w("jwSetVolume",F);return x};x.loadInstream=function(G,F){y=new f.instream(this,i,G,F);return y};x.getQualityLevels=function(){return w("jwGetQualityLevels")};x.getCurrentQuality=function(){return w("jwGetCurrentQuality")};x.setCurrentQuality=function(F){w("jwSetCurrentQuality",F)};x.getCaptionsList=function(){return w("jwGetCaptionsList")};x.getCurrentCaptions=function(){return w("jwGetCurrentCaptions")};x.setCurrentCaptions=function(F){w("jwSetCurrentCaptions",F)};x.getControls=function(){return w("jwGetControls")};x.getSafeRegion=function(){return w("jwGetSafeRegion")};x.setControls=function(F){w("jwSetControls",F)};x.destroyPlayer=function(){w("jwPlayerDestroy")};var r={onBufferChange:e.JWPLAYER_MEDIA_BUFFER,onBufferFull:e.JWPLAYER_MEDIA_BUFFER_FULL,onError:e.JWPLAYER_ERROR,onFullscreen:e.JWPLAYER_FULLSCREEN,onMeta:e.JWPLAYER_MEDIA_META,onMute:e.JWPLAYER_MEDIA_MUTE,onPlaylist:e.JWPLAYER_PLAYLIST_LOADED,onPlaylistItem:e.JWPLAYER_PLAYLIST_ITEM,onPlaylistComplete:e.JWPLAYER_PLAYLIST_COMPLETE,onReady:e.API_READY,onResize:e.JWPLAYER_RESIZE,onComplete:e.JWPLAYER_MEDIA_COMPLETE,onSeek:e.JWPLAYER_MEDIA_SEEK,onTime:e.JWPLAYER_MEDIA_TIME,onVolume:e.JWPLAYER_MEDIA_VOLUME,onBeforePlay:e.JWPLAYER_MEDIA_BEFOREPLAY,onBeforeComplete:e.JWPLAYER_MEDIA_BEFORECOMPLETE,onDisplayClick:e.JWPLAYER_DISPLAY_CLICK,onControls:e.JWPLAYER_CONTROLS,onQualityLevels:e.JWPLAYER_MEDIA_LEVELS,onQualityChange:e.JWPLAYER_MEDIA_LEVEL_CHANGED,onCaptionsList:e.JWPLAYER_CAPTIONS_LIST,onCaptionsChange:e.JWPLAYER_CAPTIONS_CHANGED};a.foreach(r,function(F){x[F]=C(r[F],z)});var v={onBuffer:b.BUFFERING,onPause:b.PAUSED,onPlay:b.PLAYING,onIdle:b.IDLE};a.foreach(v,function(F){x[F]=C(v[F],q)});function C(F,G){return function(H){return G(F,H)}}x.remove=function(){if(!D){throw"Cannot call remove() before player is ready";return}m(this)};function m(F){p=[];f.destroyPlayer(F.id)}x.setup=function(F){if(d.embed){var G=g.getElementById(x.id);if(G){F.fallbackDiv=G}m(x);var H=d(x.id);H.config=F;return new d.embed(H)}return x};x.registerPlugin=function(I,H,G,F){d.plugins.registerPlugin(I,H,G,F)};x.setPlayer=function(F,G){i=F;x.renderingMode=G};x.detachMedia=function(){if(x.renderingMode=="html5"){return w("jwDetachMedia")}};x.attachMedia=function(){if(x.renderingMode=="html5"){return w("jwAttachMedia")}};function q(F,G){if(!l[F]){l[F]=[];z(e.JWPLAYER_PLAYER_STATE,E(F))}l[F].push(G);return x}function E(F){return function(H){var G=H.newstate,J=H.oldstate;if(G==F){var I=l[G];if(I){for(var K=0;K<I.length;K++){if(typeof I[K]=="function"){I[K].call(this,{oldstate:J,newstate:G})}}}}}}function B(F,G,H){if(!A[F]){A[F]={}}if(!A[F][G]){A[F][G]=[];z(G,k(F,G))}A[F][G].push(H);return x}function k(F,G){return function(I){if(F==I.component){var H=A[F][G];if(H){for(var J=0;J<H.length;J++){if(typeof H[J]=="function"){H[J].call(this,I)}}}}}}function j(F,G){try{F.jwAddEventListener(G,'function(dat) { jwplayer("'+x.id+'").dispatchEvent("'+G+'", dat); }')}catch(H){a.log("Could not add internal listener")}}function z(F,G){if(!h[F]){h[F]=[];if(i&&D){j(i,F)}}h[F].push(G);return x}x.dispatchEvent=function(H){if(h[H]){var G=a.translateEventResponse(H,arguments[1]);for(var F=0;F<h[H].length;F++){if(typeof h[H][F]=="function"){h[H][F].call(this,G)}}}};x.dispatchInstreamEvent=function(F){if(y){y.dispatchEvent(F,arguments)}};function w(){if(D){var H=arguments[0],F=[];for(var G=1;G<arguments.length;G++){F.push(arguments[G])}if(typeof i!="undefined"&&typeof i[H]=="function"){switch(F.length){case 4:return(i[H])(F[0],F[1],F[2],F[3]);case 3:return(i[H])(F[0],F[1],F[2]);case 2:return(i[H])(F[0],F[1]);case 1:return(i[H])(F[0]);default:return(i[H])()}}return null}else{p.push(arguments)}}x.playerReady=function(F){D=true;if(!i){x.setPlayer(g.getElementById(F.id))}x.container=g.getElementById(x.id);a.foreach(h,function(G){j(i,G)});z(e.JWPLAYER_PLAYLIST_ITEM,function(G){s={}});z(e.JWPLAYER_MEDIA_META,function(G){a.extend(s,G.metadata)});x.dispatchEvent(e.API_READY);while(p.length>0){w.apply(this,p.shift())}};x.getItemMeta=function(){return s};x.getCurrentItem=function(){return w("jwGetPlaylistIndex")};function u(H,J,I){var F=[];if(!J){J=0}if(!I){I=H.length-1}for(var G=J;G<=I;G++){F.push(H[G])}return F}return x};f.selectPlayer=function(i){var h;if(!a.exists(i)){i=0}if(i.nodeType){h=i}else{if(typeof i=="string"){h=g.getElementById(i)}}if(h){var j=f.playerById(h.id);if(j){return j}else{return f.addPlayer(new f(h))}}else{if(typeof i=="number"){return c[i]}}return null};f.playerById=function(i){for(var h=0;h<c.length;h++){if(c[h].id==i){return c[h]}}return null};f.addPlayer=function(h){for(var i=0;i<c.length;i++){if(c[i]==h){return h}}c.push(h);return h};f.destroyPlayer=function(j){var i=-1,k;for(var m=0;m<c.length;m++){if(c[m].id==j){i=m;k=c[m];continue}}if(i>=0){var n=k.id,h=g.getElementById(n+(k.renderingMode=="flash"?"_wrapper":""));if(a.clearCss){a.clearCss("#"+n)}if(h){if(k.renderingMode=="html5"){k.destroyPlayer()}var l=g.createElement("div");l.id=n;h.parentNode.replaceChild(l,h)}c.splice(i,1)}return null};d.playerReady=function(i){var h=d.api.playerById(i.id);if(h){h.playerReady(i)}else{d.api.selectPlayer(i.id).playerReady(i)}}})(jwplayer);(function(b){var c=b.events,a=c.state;b.api.instream=function(e,k,o,r){var j=e,d=k,i=o,l=r,g={},q={};function h(){j.callInternal("jwLoadInstream",o,r)}function n(s,t){d.jwInstreamAddEventListener(t,'function(dat) { jwplayer("'+j.id+'").dispatchInstreamEvent("'+t+'", dat); }')}function f(s,t){if(!g[s]){g[s]=[];n(d,s)}g[s].push(t);return this}function p(s,t){if(!q[s]){q[s]=[];f(c.JWPLAYER_PLAYER_STATE,m(s))}q[s].push(t);return this}function m(s){return function(u){var t=u.newstate,w=u.oldstate;if(t==s){var v=q[t];if(v){for(var x=0;x<v.length;x++){if(typeof v[x]=="function"){v[x].call(this,{oldstate:w,newstate:t,type:u.type})}}}}}}this.dispatchEvent=function(v,u){if(g[v]){var t=_utils.translateEventResponse(v,u[1]);for(var s=0;s<g[v].length;s++){if(typeof g[v][s]=="function"){g[v][s].call(this,t)}}}};this.onError=function(s){return f(c.JWPLAYER_ERROR,s)};this.onFullscreen=function(s){return f(c.JWPLAYER_FULLSCREEN,s)};this.onMeta=function(s){return f(c.JWPLAYER_MEDIA_META,s)};this.onMute=function(s){return f(c.JWPLAYER_MEDIA_MUTE,s)};this.onComplete=function(s){return f(c.JWPLAYER_MEDIA_COMPLETE,s)};this.onSeek=function(s){return f(c.JWPLAYER_MEDIA_SEEK,s)};this.onTime=function(s){return f(c.JWPLAYER_MEDIA_TIME,s)};this.onVolume=function(s){return f(c.JWPLAYER_MEDIA_VOLUME,s)};this.onBuffer=function(s){return p(a.BUFFERING,s)};this.onPause=function(s){return p(a.PAUSED,s)};this.onPlay=function(s){return p(a.PLAYING,s)};this.onIdle=function(s){return p(a.IDLE,s)};this.onInstreamClick=function(s){return f(c.JWPLAYER_INSTREAM_CLICK,s)};this.onInstreamDestroyed=function(s){return f(c.JWPLAYER_INSTREAM_DESTROYED,s)};this.play=function(s){d.jwInstreamPlay(s)};this.pause=function(s){d.jwInstreamPause(s)};this.seek=function(s){d.jwInstreamSeek(s)};this.destroy=function(){d.jwInstreamDestroy()};this.getState=function(){return d.jwInstreamGetState()};this.getDuration=function(){return d.jwInstreamGetDuration()};this.getPosition=function(){return d.jwInstreamGetPosition()};h()}})(jwplayer);(function(a){var b=a.api,c=b.selectPlayer;b.selectPlayer=function(d){var e=c(d);if(e){return e}else{return{registerPlugin:function(i,h,g,f){a.plugins.registerPlugin(i,h,g)}}}}})(jwplayer)}; |
trunk/research/players/osmf.html
0 → 100755
| 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + #main_modal { | ||
| 16 | + width: 700px; | ||
| 17 | + margin-left: -350px; | ||
| 18 | + } | ||
| 19 | + </style> | ||
| 20 | + <script type="text/javascript"> | ||
| 21 | + function osmf_play(url) { | ||
| 22 | + $("#div_container").remove(); | ||
| 23 | + | ||
| 24 | + var div_container = $("<div/>"); | ||
| 25 | + $(div_container).attr("id", "div_container"); | ||
| 26 | + $("#player").append(div_container); | ||
| 27 | + | ||
| 28 | + var player = $("<div/>"); | ||
| 29 | + $(player).attr("id", "player_id"); | ||
| 30 | + $(div_container).append(player); | ||
| 31 | + | ||
| 32 | + var flashvars = {}; | ||
| 33 | + flashvars.src = url; | ||
| 34 | + flashvars.streamType = "live"; // live or recorded | ||
| 35 | + flashvars.autoPlay = true; | ||
| 36 | + flashvars.controlBarAutoHide = false; | ||
| 37 | + flashvars.scaleMode = "stretch"; | ||
| 38 | + flashvars.bufferTime = 0.8; | ||
| 39 | + | ||
| 40 | + var params = {}; | ||
| 41 | + params.allowFullScreen = true; | ||
| 42 | + | ||
| 43 | + var attributes = {}; | ||
| 44 | + | ||
| 45 | + swfobject.embedSWF( | ||
| 46 | + "js/StrobeMediaPlayback.swf", "player_id", | ||
| 47 | + srs_get_player_width(), srs_get_player_height(), | ||
| 48 | + "11.1", "js/AdobeFlashPlayerInstall.swf", | ||
| 49 | + flashvars, params, attributes | ||
| 50 | + ); | ||
| 51 | + } | ||
| 52 | + $(function(){ | ||
| 53 | + // get the vhost and port to set the default url. | ||
| 54 | + // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo | ||
| 55 | + // url set to: rtmp://demo:1935/live/livestream | ||
| 56 | + srs_init("#txt_url", null, "#main_modal"); | ||
| 57 | + | ||
| 58 | + $("#main_modal").on("hide", function(){ | ||
| 59 | + osmf_play("http://localhost"); | ||
| 60 | + $("#div_container").remove(); | ||
| 61 | + }); | ||
| 62 | + $("#main_modal").on("show", function(){ | ||
| 63 | + var url = $("#txt_url").val(); | ||
| 64 | + osmf_play(url); | ||
| 65 | + }); | ||
| 66 | + | ||
| 67 | + $("#btn_play").click(function(){ | ||
| 68 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 69 | + }); | ||
| 70 | + }); | ||
| 71 | + </script> | ||
| 72 | +</head> | ||
| 73 | +<body> | ||
| 74 | +<div class="navbar navbar-fixed-top"> | ||
| 75 | + <div class="navbar-inner"> | ||
| 76 | + <div class="container"> | ||
| 77 | + <a class="brand" href="index.html">SRS</a> | ||
| 78 | + <div class="nav-collapse collapse"> | ||
| 79 | + <ul class="nav"> | ||
| 80 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 81 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 82 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 83 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 84 | + <li class="active"><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 85 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 86 | + </ul> | ||
| 87 | + </div> | ||
| 88 | + </div> | ||
| 89 | + </div> | ||
| 90 | +</div> | ||
| 91 | +<div class="container"> | ||
| 92 | + <div class="alert alert-info fade in"> | ||
| 93 | + <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 94 | + <strong><span>Usage:</span></strong> <span>输入地址后点击播放按钮</span> | ||
| 95 | + </div> | ||
| 96 | + <div class="form-inline"> | ||
| 97 | + URL: | ||
| 98 | + <input type="text" id="txt_url" class="input-xxlarge" value=""></input> | ||
| 99 | + <button class="btn btn-primary" id="btn_play">播放视频</button> | ||
| 100 | + </div> | ||
| 101 | + <div id="main_modal" class="modal hide fade"> | ||
| 102 | + <div class="modal-header"> | ||
| 103 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 104 | + <h3>AdobeOSMF</h3> | ||
| 105 | + </div> | ||
| 106 | + <div class="modal-body" id="player"> | ||
| 107 | + </div> | ||
| 108 | + <div class="modal-footer"> | ||
| 109 | + <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true"> 关闭 </button> | ||
| 110 | + </div> | ||
| 111 | + </div> | ||
| 112 | + <hr> | ||
| 113 | + <footer> | ||
| 114 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 115 | + </footer> | ||
| 116 | +</div> | ||
| 117 | +</body> |
trunk/research/players/osmf/index.html
已删除
100755 → 0
| 1 | -<head> | ||
| 2 | - <meta http-equiv=Content-Type content="text/html;charset=utf-8"> | ||
| 3 | - <title>OSMFPlayer</title> | ||
| 4 | -</head> | ||
| 5 | - | ||
| 6 | -<style> | ||
| 7 | -body{margin:0; padding:0; color:#EEEEEE;} | ||
| 8 | -input.url{width:300px; height:20px;} | ||
| 9 | -input.size{width:40px; height:20px;} | ||
| 10 | -input.buffer{width:20px; height:20px;} | ||
| 11 | -input.play{width:60px; height: 25px;} | ||
| 12 | -select.type{width:50px; } | ||
| 13 | -span.size{padding-left:10px; padding-right:10px;} | ||
| 14 | -div.main{font-size:12px; padding:5px 10px 0px 5px; background-color:#333333;} | ||
| 15 | -div.player{padding-top:3px; padding-bottom:10px;} | ||
| 16 | -div.control{padding-bottom:10px; background-color:#333333; } | ||
| 17 | -</style> | ||
| 18 | - | ||
| 19 | -<div class="main" id="main"> | ||
| 20 | - <div id="player" class="player"></div> | ||
| 21 | - <div class="control" id="control"> | ||
| 22 | - Url(RTMP/HTTP): <input id="url" type="text" class="url" value="rtmp://demo:1935/live/livestream"></input> | ||
| 23 | - <select class="type" id="type"> | ||
| 24 | - <option value="live" selected>live</option> | ||
| 25 | - <option value="recorded">vod</option> | ||
| 26 | - </select> | ||
| 27 | - <span class="size"> | ||
| 28 | - Width: <input id="width" type="text" class="size" value="720"></input> | ||
| 29 | - Height: <input id="height" type="text" class="size" value="576"></input> | ||
| 30 | - Buffer: <input id="buffer" type="text" class="buffer" value="2"></input>(s) | ||
| 31 | - </span> | ||
| 32 | - <input type="button" class="play" value="Play" onclick="play()"></input> | ||
| 33 | - </div> | ||
| 34 | -</div> | ||
| 35 | - | ||
| 36 | -<script type="text/javascript" src="swfobject.js"></script> | ||
| 37 | - | ||
| 38 | -<script type="text/javascript"> | ||
| 39 | - player = document.getElementById("player"); | ||
| 40 | - player_div = null; | ||
| 41 | - | ||
| 42 | - function play(){ | ||
| 43 | - // remove old player | ||
| 44 | - if(player_div != null){ | ||
| 45 | - player.innerHTML = ""; | ||
| 46 | - } | ||
| 47 | - | ||
| 48 | - // create new div | ||
| 49 | - player_div = document.createElement("div"); | ||
| 50 | - player.appendChild(player_div); | ||
| 51 | - | ||
| 52 | - // set id to swfobject to create player. | ||
| 53 | - player_div.id = "player_div"; | ||
| 54 | - | ||
| 55 | - // generate player. | ||
| 56 | - var width = document.getElementById("width").value; | ||
| 57 | - var height = document.getElementById("height").value; | ||
| 58 | - | ||
| 59 | - // set new style | ||
| 60 | - var main = document.getElementById("main"); | ||
| 61 | - var min_width = 830; | ||
| 62 | - main.style.width = Math.max(min_width, width); | ||
| 63 | - | ||
| 64 | - var flashvars = {}; | ||
| 65 | - flashvars.src = document.getElementById("url").value; | ||
| 66 | - flashvars.streamType = document.getElementById("type").value; // live or recorded | ||
| 67 | - flashvars.autoPlay = true; | ||
| 68 | - flashvars.controlBarAutoHide = false; | ||
| 69 | - flashvars.scaleMode = "stretch"; | ||
| 70 | - flashvars.bufferTime = document.getElementById("buffer").value; | ||
| 71 | - | ||
| 72 | - var params = {}; | ||
| 73 | - params.allowFullScreen = true; | ||
| 74 | - | ||
| 75 | - var attributes = {}; | ||
| 76 | - | ||
| 77 | - swfobject.embedSWF( | ||
| 78 | - "StrobeMediaPlayback.swf", "player_div", | ||
| 79 | - width, height, | ||
| 80 | - "11.1", "AdobeFlashPlayerInstall.swf", | ||
| 81 | - flashvars, params, attributes | ||
| 82 | - ); | ||
| 83 | - } | ||
| 84 | - | ||
| 85 | - // play the default stream. | ||
| 86 | - play(); | ||
| 87 | -</script> |
不能预览此文件类型
不能预览此文件类型
trunk/research/players/rtmp/index.html
已删除
100755 → 0
| 1 | -<head> | ||
| 2 | - <meta http-equiv=Content-Type content="text/html;charset=utf-8"> | ||
| 3 | - <title>RtmpPlayer</title> | ||
| 4 | - <style> | ||
| 5 | - body{margin:0; padding:0; color:#EEEEEE;} | ||
| 6 | - input.url{width:400px; height:20px;} | ||
| 7 | - input.size{width:40px; height:20px;} | ||
| 8 | - input.buffer{width:20px; height:20px;} | ||
| 9 | - input.play{width:60px; height: 25px;} | ||
| 10 | - select.type{width:50px; } | ||
| 11 | - span.size{padding-left:10px; padding-right:10px;} | ||
| 12 | - div.main{font-size:12px; padding:5px 10px 0px 5px; background-color:#333333; width: 980px;} | ||
| 13 | - div.player{padding-top:3px; padding-bottom:10px;} | ||
| 14 | - div.control{padding-bottom:10px; background-color:#333333; } | ||
| 15 | - </style> | ||
| 16 | -</head> | ||
| 17 | -<script type="text/javascript" src="rtmp.player.js"></script> | ||
| 18 | -<div> | ||
| 19 | - <div id="player"></div> | ||
| 20 | -</div> | ||
| 21 | -<script type="text/javascript"> | ||
| 22 | - var o = new RtmpPlayer("player", "RtmpPlayer.swf", 1350, 1050); | ||
| 23 | - | ||
| 24 | - o.setRtmpUrl("rtmp://demo:1935/live/livestream"); | ||
| 25 | - o.admin = "admin"; | ||
| 26 | - o.password = "123456"; | ||
| 27 | - o.loop = false; | ||
| 28 | - o.cansave = true; | ||
| 29 | - o.islive = true; | ||
| 30 | - o.autostart = true; | ||
| 31 | - | ||
| 32 | - o.run(); | ||
| 33 | -</script> |
| 1 | -// china cache RTMP player: | ||
| 2 | -// run() to run player. | ||
| 3 | -// server: the RTMP server, e.g. 192.168.1.5 | ||
| 4 | -// port: the RTMP port, default is 1935. | ||
| 5 | -// adminPort: the admin port, default is 1111. | ||
| 6 | -// user: the admin login user name, default is admin. | ||
| 7 | -// password: the admin login user password, default is null. | ||
| 8 | -// app: the application of fms to play. e.g vod | ||
| 9 | -// stream: the stream of fms to play. e.g mp4:sample1_1500kbps.f4v | ||
| 10 | -// islive: if true, live mode. | ||
| 11 | -// autostart:Boolean a property which specify auto play. | ||
| 12 | -// loop:Boolean a property which specify auto loop. | ||
| 13 | -// | ||
| 14 | -// generate the release js version using GC: | ||
| 15 | -// java -jar google_closure_compiler/compiler.jar --js chinacache.src.js --js_output_file chinacache.js | ||
| 16 | -function RtmpPlayer(div_container, swf_url, width, height){ | ||
| 17 | - this.swf_url = swf_url; | ||
| 18 | - this.div_container = div_container; | ||
| 19 | - this.width = width; | ||
| 20 | - this.height = height; | ||
| 21 | - | ||
| 22 | - this.flashvars = {}; | ||
| 23 | - this.flashvars.width = width; | ||
| 24 | - this.flashvars.height = height; | ||
| 25 | - | ||
| 26 | - this.params = {}; | ||
| 27 | - this.params.quality = "high"; | ||
| 28 | - this.params.bgcolor = "#EEEEEE"; | ||
| 29 | - this.params.allowscriptaccess = "always"; | ||
| 30 | - this.params.allowfullscreen = "true"; | ||
| 31 | - this.params.wmode = "Window"; | ||
| 32 | - | ||
| 33 | - this.attributes = {}; | ||
| 34 | - var html_element_id = "RtmpPlayer"; | ||
| 35 | - this.attributes.id = html_element_id; | ||
| 36 | - this.attributes.name = html_element_id; | ||
| 37 | - this.attributes.align = "middle"; | ||
| 38 | - | ||
| 39 | - this.autostart = false; | ||
| 40 | - this.appLevel = 1; | ||
| 41 | - this.loop = false; | ||
| 42 | - this.port = 1935; | ||
| 43 | - this.adminPort = 1111; | ||
| 44 | - this.server = null; | ||
| 45 | - this.app = null; | ||
| 46 | - this.stream = null; | ||
| 47 | - this.islive = false; | ||
| 48 | - this.cansave = true; | ||
| 49 | - this.user = "admin"; | ||
| 50 | - this.password = null; | ||
| 51 | -} | ||
| 52 | - | ||
| 53 | -RtmpPlayer.prototype.setRtmpUrl = function(url) { | ||
| 54 | - var s = this.trim(url.replace("rtmp://", ""), "/"); | ||
| 55 | - | ||
| 56 | - if(s.indexOf(":") < 0 || s.indexOf(":") > s.indexOf("/")){ | ||
| 57 | - this.server = s.substr(0, s.indexOf("/")); | ||
| 58 | - s = this.trim(s.substr(this.server.length), "/"); | ||
| 59 | - } | ||
| 60 | - else{ | ||
| 61 | - this.server = s.substr(0, s.indexOf(":")); | ||
| 62 | - s = this.trim(s.substr(this.server.length), ":"); | ||
| 63 | - | ||
| 64 | - this.port = s.substr(0, s.indexOf("/")); | ||
| 65 | - s = this.trim(s.substr(this.port.length), "/"); | ||
| 66 | - } | ||
| 67 | - | ||
| 68 | - this.app = s.substr(0, s.indexOf("/")); | ||
| 69 | - s = this.trim(s.substr(this.app.length), "/"); | ||
| 70 | - | ||
| 71 | - this.stream = s; | ||
| 72 | -} | ||
| 73 | - | ||
| 74 | -RtmpPlayer.prototype.trim = function(s, str) { | ||
| 75 | - var r = s; | ||
| 76 | - | ||
| 77 | - while(r.indexOf(str) == 0){ | ||
| 78 | - r = r.substr(str.length); | ||
| 79 | - } | ||
| 80 | - while(r.lastIndexOf(str) == r.length - str.length){ | ||
| 81 | - r = r.substr(0, r.length - str.length); | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - return r; | ||
| 85 | -} | ||
| 86 | - | ||
| 87 | -RtmpPlayer.prototype.ck = function(v, pro) { | ||
| 88 | - if(v == null || v == undefined){ | ||
| 89 | - alert(pro + "不能为空!"); | ||
| 90 | - return true; | ||
| 91 | - } | ||
| 92 | - return false; | ||
| 93 | -} | ||
| 94 | - | ||
| 95 | -RtmpPlayer.prototype.run = function() { | ||
| 96 | - // const values | ||
| 97 | - swfVersionStr = "11.1"; | ||
| 98 | - xiSwfUrlStr = "AdobeFlashPlayerInstall.swf"; | ||
| 99 | - | ||
| 100 | - // check | ||
| 101 | - if(this.ck(this.autostart, "autostart(是否自动播放)") || this.ck(this.port, "port(FMS服务器端口)") | ||
| 102 | - || this.ck(this.adminPort, "adminPort(FMS服务器管理端口)") || this.ck(this.server, "server(FMS服务器地址)") | ||
| 103 | - || this.ck(this.app, "app(FMS application)") || this.ck(this.stream, "stream(流名称)") | ||
| 104 | - || this.ck(this.user, "user(FMS登录用户名)") || this.ck(this.password, "password(FMS登录用户密码)")){ | ||
| 105 | - return; | ||
| 106 | - } | ||
| 107 | - | ||
| 108 | - this.flashvars.autostart = this.autostart; | ||
| 109 | - this.flashvars.appLevel = this.appLevel; | ||
| 110 | - this.flashvars.loop = this.loop; | ||
| 111 | - this.flashvars.port = this.port; | ||
| 112 | - this.flashvars.adminPort = this.adminPort; | ||
| 113 | - this.flashvars.server = this.server; | ||
| 114 | - this.flashvars.app = this.app; | ||
| 115 | - this.flashvars.stream = this.stream; | ||
| 116 | - this.flashvars.islive = this.islive; | ||
| 117 | - this.flashvars.cansave = this.cansave; | ||
| 118 | - this.flashvars.user = this.user; | ||
| 119 | - this.flashvars.password = this.password; | ||
| 120 | - | ||
| 121 | - var chnvideoPlayerHost = this; | ||
| 122 | - swfobject.embedSWF( | ||
| 123 | - this.swf_url, this.div_container, | ||
| 124 | - this.width, this.height, | ||
| 125 | - swfVersionStr, xiSwfUrlStr, | ||
| 126 | - this.flashvars, this.params, this.attributes, | ||
| 127 | - function(callbackObj){ | ||
| 128 | - chnvideoPlayerHost.callbackObj = callbackObj; | ||
| 129 | - } | ||
| 130 | - ); | ||
| 131 | -} | ||
| 132 | - | ||
| 133 | -/*! SWFObject v2.2 <http://code.google.com/p/swfobject/> | ||
| 134 | - is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> | ||
| 135 | -*/ | ||
| 136 | - | ||
| 137 | -var swfobject = function() { | ||
| 138 | - | ||
| 139 | - var UNDEF = "undefined", | ||
| 140 | - OBJECT = "object", | ||
| 141 | - SHOCKWAVE_FLASH = "Shockwave Flash", | ||
| 142 | - SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash", | ||
| 143 | - FLASH_MIME_TYPE = "application/x-shockwave-flash", | ||
| 144 | - EXPRESS_INSTALL_ID = "SWFObjectExprInst", | ||
| 145 | - ON_READY_STATE_CHANGE = "onreadystatechange", | ||
| 146 | - | ||
| 147 | - win = window, | ||
| 148 | - doc = document, | ||
| 149 | - nav = navigator, | ||
| 150 | - | ||
| 151 | - plugin = false, | ||
| 152 | - domLoadFnArr = [main], | ||
| 153 | - regObjArr = [], | ||
| 154 | - objIdArr = [], | ||
| 155 | - listenersArr = [], | ||
| 156 | - storedAltContent, | ||
| 157 | - storedAltContentId, | ||
| 158 | - storedCallbackFn, | ||
| 159 | - storedCallbackObj, | ||
| 160 | - isDomLoaded = false, | ||
| 161 | - isExpressInstallActive = false, | ||
| 162 | - dynamicStylesheet, | ||
| 163 | - dynamicStylesheetMedia, | ||
| 164 | - autoHideShow = true, | ||
| 165 | - | ||
| 166 | - /* Centralized function for browser feature detection | ||
| 167 | - - User agent string detection is only used when no good alternative is possible | ||
| 168 | - - Is executed directly for optimal performance | ||
| 169 | - */ | ||
| 170 | - ua = function() { | ||
| 171 | - var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF, | ||
| 172 | - u = nav.userAgent.toLowerCase(), | ||
| 173 | - p = nav.platform.toLowerCase(), | ||
| 174 | - windows = p ? /win/.test(p) : /win/.test(u), | ||
| 175 | - mac = p ? /mac/.test(p) : /mac/.test(u), | ||
| 176 | - webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit | ||
| 177 | - ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html | ||
| 178 | - playerVersion = [0,0,0], | ||
| 179 | - d = null; | ||
| 180 | - if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) { | ||
| 181 | - d = nav.plugins[SHOCKWAVE_FLASH].description; | ||
| 182 | - if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+ | ||
| 183 | - plugin = true; | ||
| 184 | - ie = false; // cascaded feature detection for Internet Explorer | ||
| 185 | - d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1"); | ||
| 186 | - playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10); | ||
| 187 | - playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10); | ||
| 188 | - playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0; | ||
| 189 | - } | ||
| 190 | - } | ||
| 191 | - else if (typeof win.ActiveXObject != UNDEF) { | ||
| 192 | - try { | ||
| 193 | - var a = new ActiveXObject(SHOCKWAVE_FLASH_AX); | ||
| 194 | - if (a) { // a will return null when ActiveX is disabled | ||
| 195 | - d = a.GetVariable("$version"); | ||
| 196 | - if (d) { | ||
| 197 | - ie = true; // cascaded feature detection for Internet Explorer | ||
| 198 | - d = d.split(" ")[1].split(","); | ||
| 199 | - playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; | ||
| 200 | - } | ||
| 201 | - } | ||
| 202 | - } | ||
| 203 | - catch(e) {} | ||
| 204 | - } | ||
| 205 | - return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac }; | ||
| 206 | - }(), | ||
| 207 | - | ||
| 208 | - /* Cross-browser onDomLoad | ||
| 209 | - - Will fire an event as soon as the DOM of a web page is loaded | ||
| 210 | - - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/ | ||
| 211 | - - Regular onload serves as fallback | ||
| 212 | - */ | ||
| 213 | - onDomLoad = function() { | ||
| 214 | - if (!ua.w3) { return; } | ||
| 215 | - if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically | ||
| 216 | - callDomLoadFunctions(); | ||
| 217 | - } | ||
| 218 | - if (!isDomLoaded) { | ||
| 219 | - if (typeof doc.addEventListener != UNDEF) { | ||
| 220 | - doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false); | ||
| 221 | - } | ||
| 222 | - if (ua.ie && ua.win) { | ||
| 223 | - doc.attachEvent(ON_READY_STATE_CHANGE, function() { | ||
| 224 | - if (doc.readyState == "complete") { | ||
| 225 | - doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee); | ||
| 226 | - callDomLoadFunctions(); | ||
| 227 | - } | ||
| 228 | - }); | ||
| 229 | - if (win == top) { // if not inside an iframe | ||
| 230 | - (function(){ | ||
| 231 | - if (isDomLoaded) { return; } | ||
| 232 | - try { | ||
| 233 | - doc.documentElement.doScroll("left"); | ||
| 234 | - } | ||
| 235 | - catch(e) { | ||
| 236 | - setTimeout(arguments.callee, 0); | ||
| 237 | - return; | ||
| 238 | - } | ||
| 239 | - callDomLoadFunctions(); | ||
| 240 | - })(); | ||
| 241 | - } | ||
| 242 | - } | ||
| 243 | - if (ua.wk) { | ||
| 244 | - (function(){ | ||
| 245 | - if (isDomLoaded) { return; } | ||
| 246 | - if (!/loaded|complete/.test(doc.readyState)) { | ||
| 247 | - setTimeout(arguments.callee, 0); | ||
| 248 | - return; | ||
| 249 | - } | ||
| 250 | - callDomLoadFunctions(); | ||
| 251 | - })(); | ||
| 252 | - } | ||
| 253 | - addLoadEvent(callDomLoadFunctions); | ||
| 254 | - } | ||
| 255 | - }(); | ||
| 256 | - | ||
| 257 | - function callDomLoadFunctions() { | ||
| 258 | - if (isDomLoaded) { return; } | ||
| 259 | - try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early | ||
| 260 | - var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span")); | ||
| 261 | - t.parentNode.removeChild(t); | ||
| 262 | - } | ||
| 263 | - catch (e) { return; } | ||
| 264 | - isDomLoaded = true; | ||
| 265 | - var dl = domLoadFnArr.length; | ||
| 266 | - for (var i = 0; i < dl; i++) { | ||
| 267 | - domLoadFnArr[i](); | ||
| 268 | - } | ||
| 269 | - } | ||
| 270 | - | ||
| 271 | - function addDomLoadEvent(fn) { | ||
| 272 | - if (isDomLoaded) { | ||
| 273 | - fn(); | ||
| 274 | - } | ||
| 275 | - else { | ||
| 276 | - domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+ | ||
| 277 | - } | ||
| 278 | - } | ||
| 279 | - | ||
| 280 | - /* Cross-browser onload | ||
| 281 | - - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/ | ||
| 282 | - - Will fire an event as soon as a web page including all of its assets are loaded | ||
| 283 | - */ | ||
| 284 | - function addLoadEvent(fn) { | ||
| 285 | - if (typeof win.addEventListener != UNDEF) { | ||
| 286 | - win.addEventListener("load", fn, false); | ||
| 287 | - } | ||
| 288 | - else if (typeof doc.addEventListener != UNDEF) { | ||
| 289 | - doc.addEventListener("load", fn, false); | ||
| 290 | - } | ||
| 291 | - else if (typeof win.attachEvent != UNDEF) { | ||
| 292 | - addListener(win, "onload", fn); | ||
| 293 | - } | ||
| 294 | - else if (typeof win.onload == "function") { | ||
| 295 | - var fnOld = win.onload; | ||
| 296 | - win.onload = function() { | ||
| 297 | - fnOld(); | ||
| 298 | - fn(); | ||
| 299 | - }; | ||
| 300 | - } | ||
| 301 | - else { | ||
| 302 | - win.onload = fn; | ||
| 303 | - } | ||
| 304 | - } | ||
| 305 | - | ||
| 306 | - /* Main function | ||
| 307 | - - Will preferably execute onDomLoad, otherwise onload (as a fallback) | ||
| 308 | - */ | ||
| 309 | - function main() { | ||
| 310 | - if (plugin) { | ||
| 311 | - testPlayerVersion(); | ||
| 312 | - } | ||
| 313 | - else { | ||
| 314 | - matchVersions(); | ||
| 315 | - } | ||
| 316 | - } | ||
| 317 | - | ||
| 318 | - /* Detect the Flash Player version for non-Internet Explorer browsers | ||
| 319 | - - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description: | ||
| 320 | - a. Both release and build numbers can be detected | ||
| 321 | - b. Avoid wrong descriptions by corrupt installers provided by Adobe | ||
| 322 | - c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports | ||
| 323 | - - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available | ||
| 324 | - */ | ||
| 325 | - function testPlayerVersion() { | ||
| 326 | - var b = doc.getElementsByTagName("body")[0]; | ||
| 327 | - var o = createElement(OBJECT); | ||
| 328 | - o.setAttribute("type", FLASH_MIME_TYPE); | ||
| 329 | - var t = b.appendChild(o); | ||
| 330 | - if (t) { | ||
| 331 | - var counter = 0; | ||
| 332 | - (function(){ | ||
| 333 | - if (typeof t.GetVariable != UNDEF) { | ||
| 334 | - var d = t.GetVariable("$version"); | ||
| 335 | - if (d) { | ||
| 336 | - d = d.split(" ")[1].split(","); | ||
| 337 | - ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)]; | ||
| 338 | - } | ||
| 339 | - } | ||
| 340 | - else if (counter < 10) { | ||
| 341 | - counter++; | ||
| 342 | - setTimeout(arguments.callee, 10); | ||
| 343 | - return; | ||
| 344 | - } | ||
| 345 | - b.removeChild(o); | ||
| 346 | - t = null; | ||
| 347 | - matchVersions(); | ||
| 348 | - })(); | ||
| 349 | - } | ||
| 350 | - else { | ||
| 351 | - matchVersions(); | ||
| 352 | - } | ||
| 353 | - } | ||
| 354 | - | ||
| 355 | - /* Perform Flash Player and SWF version matching; static publishing only | ||
| 356 | - */ | ||
| 357 | - function matchVersions() { | ||
| 358 | - var rl = regObjArr.length; | ||
| 359 | - if (rl > 0) { | ||
| 360 | - for (var i = 0; i < rl; i++) { // for each registered object element | ||
| 361 | - var id = regObjArr[i].id; | ||
| 362 | - var cb = regObjArr[i].callbackFn; | ||
| 363 | - var cbObj = {success:false, id:id}; | ||
| 364 | - if (ua.pv[0] > 0) { | ||
| 365 | - var obj = getElementById(id); | ||
| 366 | - if (obj) { | ||
| 367 | - if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match! | ||
| 368 | - setVisibility(id, true); | ||
| 369 | - if (cb) { | ||
| 370 | - cbObj.success = true; | ||
| 371 | - cbObj.ref = getObjectById(id); | ||
| 372 | - cb(cbObj); | ||
| 373 | - } | ||
| 374 | - } | ||
| 375 | - else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported | ||
| 376 | - var att = {}; | ||
| 377 | - att.data = regObjArr[i].expressInstall; | ||
| 378 | - att.width = obj.getAttribute("width") || "0"; | ||
| 379 | - att.height = obj.getAttribute("height") || "0"; | ||
| 380 | - if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); } | ||
| 381 | - if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); } | ||
| 382 | - // parse HTML object param element's name-value pairs | ||
| 383 | - var par = {}; | ||
| 384 | - var p = obj.getElementsByTagName("param"); | ||
| 385 | - var pl = p.length; | ||
| 386 | - for (var j = 0; j < pl; j++) { | ||
| 387 | - if (p[j].getAttribute("name").toLowerCase() != "movie") { | ||
| 388 | - par[p[j].getAttribute("name")] = p[j].getAttribute("value"); | ||
| 389 | - } | ||
| 390 | - } | ||
| 391 | - showExpressInstall(att, par, id, cb); | ||
| 392 | - } | ||
| 393 | - else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF | ||
| 394 | - displayAltContent(obj); | ||
| 395 | - if (cb) { cb(cbObj); } | ||
| 396 | - } | ||
| 397 | - } | ||
| 398 | - } | ||
| 399 | - else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content) | ||
| 400 | - setVisibility(id, true); | ||
| 401 | - if (cb) { | ||
| 402 | - var o = getObjectById(id); // test whether there is an HTML object element or not | ||
| 403 | - if (o && typeof o.SetVariable != UNDEF) { | ||
| 404 | - cbObj.success = true; | ||
| 405 | - cbObj.ref = o; | ||
| 406 | - } | ||
| 407 | - cb(cbObj); | ||
| 408 | - } | ||
| 409 | - } | ||
| 410 | - } | ||
| 411 | - } | ||
| 412 | - } | ||
| 413 | - | ||
| 414 | - function getObjectById(objectIdStr) { | ||
| 415 | - var r = null; | ||
| 416 | - var o = getElementById(objectIdStr); | ||
| 417 | - if (o && o.nodeName == "OBJECT") { | ||
| 418 | - if (typeof o.SetVariable != UNDEF) { | ||
| 419 | - r = o; | ||
| 420 | - } | ||
| 421 | - else { | ||
| 422 | - var n = o.getElementsByTagName(OBJECT)[0]; | ||
| 423 | - if (n) { | ||
| 424 | - r = n; | ||
| 425 | - } | ||
| 426 | - } | ||
| 427 | - } | ||
| 428 | - return r; | ||
| 429 | - } | ||
| 430 | - | ||
| 431 | - /* Requirements for Adobe Express Install | ||
| 432 | - - only one instance can be active at a time | ||
| 433 | - - fp 6.0.65 or higher | ||
| 434 | - - Win/Mac OS only | ||
| 435 | - - no Webkit engines older than version 312 | ||
| 436 | - */ | ||
| 437 | - function canExpressInstall() { | ||
| 438 | - return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312); | ||
| 439 | - } | ||
| 440 | - | ||
| 441 | - /* Show the Adobe Express Install dialog | ||
| 442 | - - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75 | ||
| 443 | - */ | ||
| 444 | - function showExpressInstall(att, par, replaceElemIdStr, callbackFn) { | ||
| 445 | - isExpressInstallActive = true; | ||
| 446 | - storedCallbackFn = callbackFn || null; | ||
| 447 | - storedCallbackObj = {success:false, id:replaceElemIdStr}; | ||
| 448 | - var obj = getElementById(replaceElemIdStr); | ||
| 449 | - if (obj) { | ||
| 450 | - if (obj.nodeName == "OBJECT") { // static publishing | ||
| 451 | - storedAltContent = abstractAltContent(obj); | ||
| 452 | - storedAltContentId = null; | ||
| 453 | - } | ||
| 454 | - else { // dynamic publishing | ||
| 455 | - storedAltContent = obj; | ||
| 456 | - storedAltContentId = replaceElemIdStr; | ||
| 457 | - } | ||
| 458 | - att.id = EXPRESS_INSTALL_ID; | ||
| 459 | - if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; } | ||
| 460 | - if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; } | ||
| 461 | - doc.title = doc.title.slice(0, 47) + " - Flash Player Installation"; | ||
| 462 | - var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn", | ||
| 463 | - fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title; | ||
| 464 | - if (typeof par.flashvars != UNDEF) { | ||
| 465 | - par.flashvars += "&" + fv; | ||
| 466 | - } | ||
| 467 | - else { | ||
| 468 | - par.flashvars = fv; | ||
| 469 | - } | ||
| 470 | - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, | ||
| 471 | - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work | ||
| 472 | - if (ua.ie && ua.win && obj.readyState != 4) { | ||
| 473 | - var newObj = createElement("div"); | ||
| 474 | - replaceElemIdStr += "SWFObjectNew"; | ||
| 475 | - newObj.setAttribute("id", replaceElemIdStr); | ||
| 476 | - obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf | ||
| 477 | - obj.style.display = "none"; | ||
| 478 | - (function(){ | ||
| 479 | - if (obj.readyState == 4) { | ||
| 480 | - obj.parentNode.removeChild(obj); | ||
| 481 | - } | ||
| 482 | - else { | ||
| 483 | - setTimeout(arguments.callee, 10); | ||
| 484 | - } | ||
| 485 | - })(); | ||
| 486 | - } | ||
| 487 | - createSWF(att, par, replaceElemIdStr); | ||
| 488 | - } | ||
| 489 | - } | ||
| 490 | - | ||
| 491 | - /* Functions to abstract and display alternative content | ||
| 492 | - */ | ||
| 493 | - function displayAltContent(obj) { | ||
| 494 | - if (ua.ie && ua.win && obj.readyState != 4) { | ||
| 495 | - // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it, | ||
| 496 | - // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work | ||
| 497 | - var el = createElement("div"); | ||
| 498 | - obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content | ||
| 499 | - el.parentNode.replaceChild(abstractAltContent(obj), el); | ||
| 500 | - obj.style.display = "none"; | ||
| 501 | - (function(){ | ||
| 502 | - if (obj.readyState == 4) { | ||
| 503 | - obj.parentNode.removeChild(obj); | ||
| 504 | - } | ||
| 505 | - else { | ||
| 506 | - setTimeout(arguments.callee, 10); | ||
| 507 | - } | ||
| 508 | - })(); | ||
| 509 | - } | ||
| 510 | - else { | ||
| 511 | - obj.parentNode.replaceChild(abstractAltContent(obj), obj); | ||
| 512 | - } | ||
| 513 | - } | ||
| 514 | - | ||
| 515 | - function abstractAltContent(obj) { | ||
| 516 | - var ac = createElement("div"); | ||
| 517 | - if (ua.win && ua.ie) { | ||
| 518 | - ac.innerHTML = obj.innerHTML; | ||
| 519 | - } | ||
| 520 | - else { | ||
| 521 | - var nestedObj = obj.getElementsByTagName(OBJECT)[0]; | ||
| 522 | - if (nestedObj) { | ||
| 523 | - var c = nestedObj.childNodes; | ||
| 524 | - if (c) { | ||
| 525 | - var cl = c.length; | ||
| 526 | - for (var i = 0; i < cl; i++) { | ||
| 527 | - if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) { | ||
| 528 | - ac.appendChild(c[i].cloneNode(true)); | ||
| 529 | - } | ||
| 530 | - } | ||
| 531 | - } | ||
| 532 | - } | ||
| 533 | - } | ||
| 534 | - return ac; | ||
| 535 | - } | ||
| 536 | - | ||
| 537 | - /* Cross-browser dynamic SWF creation | ||
| 538 | - */ | ||
| 539 | - function createSWF(attObj, parObj, id) { | ||
| 540 | - var r, el = getElementById(id); | ||
| 541 | - if (ua.wk && ua.wk < 312) { return r; } | ||
| 542 | - if (el) { | ||
| 543 | - if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content | ||
| 544 | - attObj.id = id; | ||
| 545 | - } | ||
| 546 | - if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML | ||
| 547 | - var att = ""; | ||
| 548 | - for (var i in attObj) { | ||
| 549 | - if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries | ||
| 550 | - if (i.toLowerCase() == "data") { | ||
| 551 | - parObj.movie = attObj[i]; | ||
| 552 | - } | ||
| 553 | - else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword | ||
| 554 | - att += ' class="' + attObj[i] + '"'; | ||
| 555 | - } | ||
| 556 | - else if (i.toLowerCase() != "classid") { | ||
| 557 | - att += ' ' + i + '="' + attObj[i] + '"'; | ||
| 558 | - } | ||
| 559 | - } | ||
| 560 | - } | ||
| 561 | - var par = ""; | ||
| 562 | - for (var j in parObj) { | ||
| 563 | - if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries | ||
| 564 | - par += '<param name="' + j + '" value="' + parObj[j] + '" />'; | ||
| 565 | - } | ||
| 566 | - } | ||
| 567 | - el.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + att + '>' + par + '</object>'; | ||
| 568 | - objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only) | ||
| 569 | - r = getElementById(attObj.id); | ||
| 570 | - } | ||
| 571 | - else { // well-behaving browsers | ||
| 572 | - var o = createElement(OBJECT); | ||
| 573 | - o.setAttribute("type", FLASH_MIME_TYPE); | ||
| 574 | - for (var m in attObj) { | ||
| 575 | - if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries | ||
| 576 | - if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword | ||
| 577 | - o.setAttribute("class", attObj[m]); | ||
| 578 | - } | ||
| 579 | - else if (m.toLowerCase() != "classid") { // filter out IE specific attribute | ||
| 580 | - o.setAttribute(m, attObj[m]); | ||
| 581 | - } | ||
| 582 | - } | ||
| 583 | - } | ||
| 584 | - for (var n in parObj) { | ||
| 585 | - if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element | ||
| 586 | - createObjParam(o, n, parObj[n]); | ||
| 587 | - } | ||
| 588 | - } | ||
| 589 | - el.parentNode.replaceChild(o, el); | ||
| 590 | - r = o; | ||
| 591 | - } | ||
| 592 | - } | ||
| 593 | - return r; | ||
| 594 | - } | ||
| 595 | - | ||
| 596 | - function createObjParam(el, pName, pValue) { | ||
| 597 | - var p = createElement("param"); | ||
| 598 | - p.setAttribute("name", pName); | ||
| 599 | - p.setAttribute("value", pValue); | ||
| 600 | - el.appendChild(p); | ||
| 601 | - } | ||
| 602 | - | ||
| 603 | - /* Cross-browser SWF removal | ||
| 604 | - - Especially needed to safely and completely remove a SWF in Internet Explorer | ||
| 605 | - */ | ||
| 606 | - function removeSWF(id) { | ||
| 607 | - var obj = getElementById(id); | ||
| 608 | - if (obj && obj.nodeName == "OBJECT") { | ||
| 609 | - if (ua.ie && ua.win) { | ||
| 610 | - obj.style.display = "none"; | ||
| 611 | - (function(){ | ||
| 612 | - if (obj.readyState == 4) { | ||
| 613 | - removeObjectInIE(id); | ||
| 614 | - } | ||
| 615 | - else { | ||
| 616 | - setTimeout(arguments.callee, 10); | ||
| 617 | - } | ||
| 618 | - })(); | ||
| 619 | - } | ||
| 620 | - else { | ||
| 621 | - obj.parentNode.removeChild(obj); | ||
| 622 | - } | ||
| 623 | - } | ||
| 624 | - } | ||
| 625 | - | ||
| 626 | - function removeObjectInIE(id) { | ||
| 627 | - var obj = getElementById(id); | ||
| 628 | - if (obj) { | ||
| 629 | - for (var i in obj) { | ||
| 630 | - if (typeof obj[i] == "function") { | ||
| 631 | - obj[i] = null; | ||
| 632 | - } | ||
| 633 | - } | ||
| 634 | - obj.parentNode.removeChild(obj); | ||
| 635 | - } | ||
| 636 | - } | ||
| 637 | - | ||
| 638 | - /* Functions to optimize JavaScript compression | ||
| 639 | - */ | ||
| 640 | - function getElementById(id) { | ||
| 641 | - var el = null; | ||
| 642 | - try { | ||
| 643 | - el = doc.getElementById(id); | ||
| 644 | - } | ||
| 645 | - catch (e) {} | ||
| 646 | - return el; | ||
| 647 | - } | ||
| 648 | - | ||
| 649 | - function createElement(el) { | ||
| 650 | - return doc.createElement(el); | ||
| 651 | - } | ||
| 652 | - | ||
| 653 | - /* Updated attachEvent function for Internet Explorer | ||
| 654 | - - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks | ||
| 655 | - */ | ||
| 656 | - function addListener(target, eventType, fn) { | ||
| 657 | - target.attachEvent(eventType, fn); | ||
| 658 | - listenersArr[listenersArr.length] = [target, eventType, fn]; | ||
| 659 | - } | ||
| 660 | - | ||
| 661 | - /* Flash Player and SWF content version matching | ||
| 662 | - */ | ||
| 663 | - function hasPlayerVersion(rv) { | ||
| 664 | - var pv = ua.pv, v = rv.split("."); | ||
| 665 | - v[0] = parseInt(v[0], 10); | ||
| 666 | - v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0" | ||
| 667 | - v[2] = parseInt(v[2], 10) || 0; | ||
| 668 | - return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false; | ||
| 669 | - } | ||
| 670 | - | ||
| 671 | - /* Cross-browser dynamic CSS creation | ||
| 672 | - - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php | ||
| 673 | - */ | ||
| 674 | - function createCSS(sel, decl, media, newStyle) { | ||
| 675 | - if (ua.ie && ua.mac) { return; } | ||
| 676 | - var h = doc.getElementsByTagName("head")[0]; | ||
| 677 | - if (!h) { return; } // to also support badly authored HTML pages that lack a head element | ||
| 678 | - var m = (media && typeof media == "string") ? media : "screen"; | ||
| 679 | - if (newStyle) { | ||
| 680 | - dynamicStylesheet = null; | ||
| 681 | - dynamicStylesheetMedia = null; | ||
| 682 | - } | ||
| 683 | - if (!dynamicStylesheet || dynamicStylesheetMedia != m) { | ||
| 684 | - // create dynamic stylesheet + get a global reference to it | ||
| 685 | - var s = createElement("style"); | ||
| 686 | - s.setAttribute("type", "text/css"); | ||
| 687 | - s.setAttribute("media", m); | ||
| 688 | - dynamicStylesheet = h.appendChild(s); | ||
| 689 | - if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) { | ||
| 690 | - dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1]; | ||
| 691 | - } | ||
| 692 | - dynamicStylesheetMedia = m; | ||
| 693 | - } | ||
| 694 | - // add style rule | ||
| 695 | - if (ua.ie && ua.win) { | ||
| 696 | - if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) { | ||
| 697 | - dynamicStylesheet.addRule(sel, decl); | ||
| 698 | - } | ||
| 699 | - } | ||
| 700 | - else { | ||
| 701 | - if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) { | ||
| 702 | - dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}")); | ||
| 703 | - } | ||
| 704 | - } | ||
| 705 | - } | ||
| 706 | - | ||
| 707 | - function setVisibility(id, isVisible) { | ||
| 708 | - if (!autoHideShow) { return; } | ||
| 709 | - var v = isVisible ? "visible" : "hidden"; | ||
| 710 | - if (isDomLoaded && getElementById(id)) { | ||
| 711 | - getElementById(id).style.visibility = v; | ||
| 712 | - } | ||
| 713 | - else { | ||
| 714 | - createCSS("#" + id, "visibility:" + v); | ||
| 715 | - } | ||
| 716 | - } | ||
| 717 | - | ||
| 718 | - /* Filter to avoid XSS attacks | ||
| 719 | - */ | ||
| 720 | - function urlEncodeIfNecessary(s) { | ||
| 721 | - var regex = /[\\\"<>\.;]/; | ||
| 722 | - var hasBadChars = regex.exec(s) != null; | ||
| 723 | - return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s; | ||
| 724 | - } | ||
| 725 | - | ||
| 726 | - /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only) | ||
| 727 | - */ | ||
| 728 | - var cleanup = function() { | ||
| 729 | - if (ua.ie && ua.win) { | ||
| 730 | - window.attachEvent("onunload", function() { | ||
| 731 | - // remove listeners to avoid memory leaks | ||
| 732 | - var ll = listenersArr.length; | ||
| 733 | - for (var i = 0; i < ll; i++) { | ||
| 734 | - listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]); | ||
| 735 | - } | ||
| 736 | - // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect | ||
| 737 | - var il = objIdArr.length; | ||
| 738 | - for (var j = 0; j < il; j++) { | ||
| 739 | - removeSWF(objIdArr[j]); | ||
| 740 | - } | ||
| 741 | - // cleanup library's main closures to avoid memory leaks | ||
| 742 | - for (var k in ua) { | ||
| 743 | - ua[k] = null; | ||
| 744 | - } | ||
| 745 | - ua = null; | ||
| 746 | - for (var l in swfobject) { | ||
| 747 | - swfobject[l] = null; | ||
| 748 | - } | ||
| 749 | - swfobject = null; | ||
| 750 | - }); | ||
| 751 | - } | ||
| 752 | - }(); | ||
| 753 | - | ||
| 754 | - return { | ||
| 755 | - /* Public API | ||
| 756 | - - Reference: http://code.google.com/p/swfobject/wiki/documentation | ||
| 757 | - */ | ||
| 758 | - registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) { | ||
| 759 | - if (ua.w3 && objectIdStr && swfVersionStr) { | ||
| 760 | - var regObj = {}; | ||
| 761 | - regObj.id = objectIdStr; | ||
| 762 | - regObj.swfVersion = swfVersionStr; | ||
| 763 | - regObj.expressInstall = xiSwfUrlStr; | ||
| 764 | - regObj.callbackFn = callbackFn; | ||
| 765 | - regObjArr[regObjArr.length] = regObj; | ||
| 766 | - setVisibility(objectIdStr, false); | ||
| 767 | - } | ||
| 768 | - else if (callbackFn) { | ||
| 769 | - callbackFn({success:false, id:objectIdStr}); | ||
| 770 | - } | ||
| 771 | - }, | ||
| 772 | - | ||
| 773 | - getObjectById: function(objectIdStr) { | ||
| 774 | - if (ua.w3) { | ||
| 775 | - return getObjectById(objectIdStr); | ||
| 776 | - } | ||
| 777 | - }, | ||
| 778 | - | ||
| 779 | - embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) { | ||
| 780 | - var callbackObj = {success:false, id:replaceElemIdStr}; | ||
| 781 | - if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) { | ||
| 782 | - setVisibility(replaceElemIdStr, false); | ||
| 783 | - addDomLoadEvent(function() { | ||
| 784 | - widthStr += ""; // auto-convert to string | ||
| 785 | - heightStr += ""; | ||
| 786 | - var att = {}; | ||
| 787 | - if (attObj && typeof attObj === OBJECT) { | ||
| 788 | - for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs | ||
| 789 | - att[i] = attObj[i]; | ||
| 790 | - } | ||
| 791 | - } | ||
| 792 | - att.data = swfUrlStr; | ||
| 793 | - att.width = widthStr; | ||
| 794 | - att.height = heightStr; | ||
| 795 | - var par = {}; | ||
| 796 | - if (parObj && typeof parObj === OBJECT) { | ||
| 797 | - for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs | ||
| 798 | - par[j] = parObj[j]; | ||
| 799 | - } | ||
| 800 | - } | ||
| 801 | - if (flashvarsObj && typeof flashvarsObj === OBJECT) { | ||
| 802 | - for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs | ||
| 803 | - if (typeof par.flashvars != UNDEF) { | ||
| 804 | - par.flashvars += "&" + k + "=" + flashvarsObj[k]; | ||
| 805 | - } | ||
| 806 | - else { | ||
| 807 | - par.flashvars = k + "=" + flashvarsObj[k]; | ||
| 808 | - } | ||
| 809 | - } | ||
| 810 | - } | ||
| 811 | - if (hasPlayerVersion(swfVersionStr)) { // create SWF | ||
| 812 | - var obj = createSWF(att, par, replaceElemIdStr); | ||
| 813 | - if (att.id == replaceElemIdStr) { | ||
| 814 | - setVisibility(replaceElemIdStr, true); | ||
| 815 | - } | ||
| 816 | - callbackObj.success = true; | ||
| 817 | - callbackObj.ref = obj; | ||
| 818 | - } | ||
| 819 | - else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install | ||
| 820 | - att.data = xiSwfUrlStr; | ||
| 821 | - showExpressInstall(att, par, replaceElemIdStr, callbackFn); | ||
| 822 | - return; | ||
| 823 | - } | ||
| 824 | - else { // show alternative content | ||
| 825 | - setVisibility(replaceElemIdStr, true); | ||
| 826 | - } | ||
| 827 | - if (callbackFn) { callbackFn(callbackObj); } | ||
| 828 | - }); | ||
| 829 | - } | ||
| 830 | - else if (callbackFn) { callbackFn(callbackObj); } | ||
| 831 | - }, | ||
| 832 | - | ||
| 833 | - switchOffAutoHideShow: function() { | ||
| 834 | - autoHideShow = false; | ||
| 835 | - }, | ||
| 836 | - | ||
| 837 | - ua: ua, | ||
| 838 | - | ||
| 839 | - getFlashPlayerVersion: function() { | ||
| 840 | - return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] }; | ||
| 841 | - }, | ||
| 842 | - | ||
| 843 | - hasFlashPlayerVersion: hasPlayerVersion, | ||
| 844 | - | ||
| 845 | - createSWF: function(attObj, parObj, replaceElemIdStr) { | ||
| 846 | - if (ua.w3) { | ||
| 847 | - return createSWF(attObj, parObj, replaceElemIdStr); | ||
| 848 | - } | ||
| 849 | - else { | ||
| 850 | - return undefined; | ||
| 851 | - } | ||
| 852 | - }, | ||
| 853 | - | ||
| 854 | - showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) { | ||
| 855 | - if (ua.w3 && canExpressInstall()) { | ||
| 856 | - showExpressInstall(att, par, replaceElemIdStr, callbackFn); | ||
| 857 | - } | ||
| 858 | - }, | ||
| 859 | - | ||
| 860 | - removeSWF: function(objElemIdStr) { | ||
| 861 | - if (ua.w3) { | ||
| 862 | - removeSWF(objElemIdStr); | ||
| 863 | - } | ||
| 864 | - }, | ||
| 865 | - | ||
| 866 | - createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) { | ||
| 867 | - if (ua.w3) { | ||
| 868 | - createCSS(selStr, declStr, mediaStr, newStyleBoolean); | ||
| 869 | - } | ||
| 870 | - }, | ||
| 871 | - | ||
| 872 | - addDomLoadEvent: addDomLoadEvent, | ||
| 873 | - | ||
| 874 | - addLoadEvent: addLoadEvent, | ||
| 875 | - | ||
| 876 | - getQueryParamValue: function(param) { | ||
| 877 | - var q = doc.location.search || doc.location.hash; | ||
| 878 | - if (q) { | ||
| 879 | - if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark | ||
| 880 | - if (param == null) { | ||
| 881 | - return urlEncodeIfNecessary(q); | ||
| 882 | - } | ||
| 883 | - var pairs = q.split("&"); | ||
| 884 | - for (var i = 0; i < pairs.length; i++) { | ||
| 885 | - if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) { | ||
| 886 | - return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1))); | ||
| 887 | - } | ||
| 888 | - } | ||
| 889 | - } | ||
| 890 | - return ""; | ||
| 891 | - }, | ||
| 892 | - | ||
| 893 | - // For internal usage only | ||
| 894 | - expressInstallCallback: function() { | ||
| 895 | - if (isExpressInstallActive) { | ||
| 896 | - var obj = getElementById(EXPRESS_INSTALL_ID); | ||
| 897 | - if (obj && storedAltContent) { | ||
| 898 | - obj.parentNode.replaceChild(storedAltContent, obj); | ||
| 899 | - if (storedAltContentId) { | ||
| 900 | - setVisibility(storedAltContentId, true); | ||
| 901 | - if (ua.ie && ua.win) { storedAltContent.style.display = "block"; } | ||
| 902 | - } | ||
| 903 | - if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); } | ||
| 904 | - } | ||
| 905 | - isExpressInstallActive = false; | ||
| 906 | - } | ||
| 907 | - } | ||
| 908 | - }; | ||
| 909 | -}(); |
trunk/research/players/srs_bwt.html
0 → 100755
| 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + </style> | ||
| 16 | + <script type="text/javascript"> | ||
| 17 | + $(function(){ | ||
| 18 | + update_nav(); | ||
| 19 | + }); | ||
| 20 | + </script> | ||
| 21 | +</head> | ||
| 22 | +<body> | ||
| 23 | +<div class="navbar navbar-fixed-top"> | ||
| 24 | + <div class="navbar-inner"> | ||
| 25 | + <div class="container"> | ||
| 26 | + <a class="brand" href="index.html">SRS</a> | ||
| 27 | + <div class="nav-collapse collapse"> | ||
| 28 | + <ul class="nav"> | ||
| 29 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 30 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 31 | + <li class="active"><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 32 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 33 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 34 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 35 | + </ul> | ||
| 36 | + </div> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | +</div> | ||
| 40 | +<div class="container"> | ||
| 41 | + <hr> | ||
| 42 | + <footer> | ||
| 43 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 44 | + </footer> | ||
| 45 | +</div> | ||
| 46 | +</body> | ||
| 47 | + |
trunk/research/players/srs_player.html
0 → 100755
| 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + #my_modal_footer { | ||
| 16 | + margin-top: -20px; | ||
| 17 | + padding-top: 3px; | ||
| 18 | + } | ||
| 19 | + #div_play_time { | ||
| 20 | + margin-top: 10px; | ||
| 21 | + } | ||
| 22 | + #pb_buffer_bg { | ||
| 23 | + margin-top: -4px; | ||
| 24 | + margin-bottom: 10px; | ||
| 25 | + } | ||
| 26 | + </style> | ||
| 27 | + <script type="text/javascript"> | ||
| 28 | + var srs_player = null; | ||
| 29 | + var url = null; | ||
| 30 | + | ||
| 31 | + var __active_dar = null; | ||
| 32 | + function select_dar(dar_id, num, den) { | ||
| 33 | + srs_player.dar(num, den); | ||
| 34 | + | ||
| 35 | + if (__active_dar) { | ||
| 36 | + __active_dar.removeClass("active"); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + __active_dar = $(dar_id).parent(); | ||
| 40 | + __active_dar.addClass("active"); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + var __active_size = null; | ||
| 44 | + function select_fs_size(size_id, refer, percent) { | ||
| 45 | + srs_player.set_fs(refer, percent); | ||
| 46 | + | ||
| 47 | + if (__active_size) { | ||
| 48 | + __active_size.removeClass("active"); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + __active_size = $(size_id).parent(); | ||
| 52 | + __active_size.addClass("active"); | ||
| 53 | + } | ||
| 54 | + | ||
| 55 | + var __active_bt = null; | ||
| 56 | + function select_buffer_time(bt_id, buffer_time) { | ||
| 57 | + srs_player.set_bt(buffer_time); | ||
| 58 | + | ||
| 59 | + if (__active_bt) { | ||
| 60 | + __active_bt.removeClass("active"); | ||
| 61 | + } | ||
| 62 | + | ||
| 63 | + __active_bt = $(bt_id).parent(); | ||
| 64 | + __active_bt.addClass("active"); | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | + $(function(){ | ||
| 68 | + // get the vhost and port to set the default url. | ||
| 69 | + // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo | ||
| 70 | + // url set to: rtmp://demo:1935/live/livestream | ||
| 71 | + srs_init("#txt_url", null, "#main_modal"); | ||
| 72 | + | ||
| 73 | + $("#fs_tips").tooltip({ | ||
| 74 | + title: "点击视频进入或退出全屏" | ||
| 75 | + }); | ||
| 76 | + | ||
| 77 | + $("#main_modal").on("show", function(){ | ||
| 78 | + if (srs_player) { | ||
| 79 | + return; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + $("#div_container").remove(); | ||
| 83 | + | ||
| 84 | + var div_container = $("<div/>"); | ||
| 85 | + $(div_container).attr("id", "div_container"); | ||
| 86 | + $("#player").append(div_container); | ||
| 87 | + | ||
| 88 | + var player = $("<div/>"); | ||
| 89 | + $(player).attr("id", "player_id"); | ||
| 90 | + $(div_container).append(player); | ||
| 91 | + | ||
| 92 | + srs_player = new SrsPlayer("player_id", srs_get_player_width(), srs_get_player_height()); | ||
| 93 | + srs_player.on_player_ready = function() { | ||
| 94 | + select_buffer_time("#btn_bt_0_8", 0.8); | ||
| 95 | + srs_player.play(url); | ||
| 96 | + }; | ||
| 97 | + srs_player.on_player_metadata = function(metadata) { | ||
| 98 | + $("#btn_dar_original").text("视频原始比例" + "(" + metadata.width + ":" + metadata.height + ")"); | ||
| 99 | + select_dar("#btn_dar_original", 0, 0); | ||
| 100 | + select_fs_size("#btn_fs_size_screen_100", "screen", 100); | ||
| 101 | + }; | ||
| 102 | + srs_player.on_player_timer = function(time, buffer_length) { | ||
| 103 | + var buffer = buffer_length / srs_player.buffer_time * 100; | ||
| 104 | + $("#pb_buffer").width(Number(buffer).toFixed(1) + "%"); | ||
| 105 | + | ||
| 106 | + $("#pb_buffer_bg").attr("title", | ||
| 107 | + "缓冲区长度:" + Number(buffer_length).toFixed(1) + "秒(" | ||
| 108 | + + Number(buffer).toFixed(1) + "%)"); | ||
| 109 | + | ||
| 110 | + var time_str = ""; | ||
| 111 | + // day | ||
| 112 | + time_str = padding(parseInt(time / 24 / 3600), 2, '0') + " "; | ||
| 113 | + // hour | ||
| 114 | + time = time % (24 * 3600); | ||
| 115 | + time_str += padding(parseInt(time / 3600), 2, '0') + ":"; | ||
| 116 | + // minute | ||
| 117 | + time = time % (3600); | ||
| 118 | + time_str += padding(parseInt(time / 60), 2, '0') + ":"; | ||
| 119 | + // seconds | ||
| 120 | + time = time % (60); | ||
| 121 | + time_str += padding(parseInt(time), 2, '0'); | ||
| 122 | + // show | ||
| 123 | + $("#txt_time").val(time_str); | ||
| 124 | + }; | ||
| 125 | + srs_player.start(); | ||
| 126 | + }); | ||
| 127 | + | ||
| 128 | + $("#main_modal").on("hide", function(){ | ||
| 129 | + if ($("#main_modal").is(":visible")) { | ||
| 130 | + return; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + if (srs_player) { | ||
| 134 | + srs_player.stop(); | ||
| 135 | + srs_player = null; | ||
| 136 | + } | ||
| 137 | + }); | ||
| 138 | + | ||
| 139 | + $("#btn_play").click(function(){ | ||
| 140 | + url = $("#txt_url").val(); | ||
| 141 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 142 | + }); | ||
| 143 | + | ||
| 144 | + $("#btn_pause").click(function(){ | ||
| 145 | + if ($("#btn_pause").text() == "暂停") { | ||
| 146 | + $("#btn_pause").text("继续"); | ||
| 147 | + srs_player.pause(); | ||
| 148 | + } else { | ||
| 149 | + $("#btn_pause").text("暂停"); | ||
| 150 | + srs_player.resume(); | ||
| 151 | + } | ||
| 152 | + }); | ||
| 153 | + | ||
| 154 | + $("#srs_publish").click(function(){ | ||
| 155 | + url = $("#srs_publish").text(); | ||
| 156 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 157 | + }); | ||
| 158 | + $("#srs_publish_ld").click(function(){ | ||
| 159 | + url = $("#srs_publish_ld").text(); | ||
| 160 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 161 | + }); | ||
| 162 | + $("#srs_publish_sd").click(function(){ | ||
| 163 | + url = $("#srs_publish_sd").text(); | ||
| 164 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 165 | + }); | ||
| 166 | + $("#srs_publish_fw").click(function(){ | ||
| 167 | + url = $("#srs_publish_fw").text(); | ||
| 168 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 169 | + }); | ||
| 170 | + $("#srs_publish_fw_ld").click(function(){ | ||
| 171 | + url = $("#srs_publish_fw_ld").text(); | ||
| 172 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 173 | + }); | ||
| 174 | + $("#srs_publish_fw_sd").click(function(){ | ||
| 175 | + url = $("#srs_publish_fw_sd").text(); | ||
| 176 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 177 | + }); | ||
| 178 | + | ||
| 179 | + var query = parse_query_string(); | ||
| 180 | + var jwplayer_url = "http://" + query.host + query.dir + "/jwplayer6.html?vhost=demo.srs.com&app=live&hls_autostart=true"; | ||
| 181 | + $("#srs_publish_hls").attr("href", jwplayer_url + "&stream=livestream"); | ||
| 182 | + $("#srs_publish_ld_hls").attr("href", jwplayer_url + "&stream=livestream_ld"); | ||
| 183 | + $("#srs_publish_sd_hls").attr("href", jwplayer_url + "&stream=livestream_sd"); | ||
| 184 | + var jwplayer_url = "http://" + query.host + query.dir + "/jwplayer6.html?vhost=demo.srs.com&app=forward/live&hls_autostart=true"; | ||
| 185 | + $("#srs_publish_fw_hls").attr("href", jwplayer_url + "&stream=livestream"); | ||
| 186 | + $("#srs_publish_fw_ld_hls").attr("href", jwplayer_url + "&stream=livestream_ld"); | ||
| 187 | + $("#srs_publish_fw_sd_hls").attr("href", jwplayer_url + "&stream=livestream_sd"); | ||
| 188 | + | ||
| 189 | + if (true) { | ||
| 190 | + $("#btn_dar_original").click(function(){ | ||
| 191 | + select_dar("#btn_dar_original", 0, 0); | ||
| 192 | + }); | ||
| 193 | + $("#btn_dar_21_9").click(function(){ | ||
| 194 | + select_dar("#btn_dar_21_9", 9, 21); | ||
| 195 | + }); | ||
| 196 | + $("#btn_dar_16_9").click(function(){ | ||
| 197 | + select_dar("#btn_dar_16_9", 9, 16); | ||
| 198 | + }); | ||
| 199 | + $("#btn_dar_4_3").click(function(){ | ||
| 200 | + select_dar("#btn_dar_4_3", 3, 4); | ||
| 201 | + }); | ||
| 202 | + $("#btn_dar_fill").click(function(){ | ||
| 203 | + select_dar("#btn_dar_fill", -1, -1); | ||
| 204 | + }); | ||
| 205 | + } | ||
| 206 | + | ||
| 207 | + if (true) { | ||
| 208 | + $("#btn_fs_size_video_100").click(function(){ | ||
| 209 | + select_fs_size("#btn_fs_size_video_100", "video", 100); | ||
| 210 | + }); | ||
| 211 | + $("#btn_fs_size_video_75").click(function(){ | ||
| 212 | + select_fs_size("#btn_fs_size_video_75", "video", 75); | ||
| 213 | + }); | ||
| 214 | + $("#btn_fs_size_video_50").click(function(){ | ||
| 215 | + select_fs_size("#btn_fs_size_video_50", "video", 50); | ||
| 216 | + }); | ||
| 217 | + $("#btn_fs_size_screen_100").click(function(){ | ||
| 218 | + select_fs_size("#btn_fs_size_screen_100", "screen", 100); | ||
| 219 | + }); | ||
| 220 | + $("#btn_fs_size_screen_75").click(function(){ | ||
| 221 | + select_fs_size("#btn_fs_size_screen_75", "screen", 75); | ||
| 222 | + }); | ||
| 223 | + $("#btn_fs_size_screen_50").click(function(){ | ||
| 224 | + select_fs_size("#btn_fs_size_screen_50", "screen", 50); | ||
| 225 | + }); | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + if (true) { | ||
| 229 | + $("#btn_bt_0_5").click(function(){ | ||
| 230 | + select_buffer_time("#btn_bt_0_5", 0.5); | ||
| 231 | + }); | ||
| 232 | + $("#btn_bt_0_8").click(function(){ | ||
| 233 | + select_buffer_time("#btn_bt_0_8", 0.8); | ||
| 234 | + }); | ||
| 235 | + $("#btn_bt_1").click(function(){ | ||
| 236 | + select_buffer_time("#btn_bt_1", 1); | ||
| 237 | + }); | ||
| 238 | + $("#btn_bt_2").click(function(){ | ||
| 239 | + select_buffer_time("#btn_bt_2", 2); | ||
| 240 | + }); | ||
| 241 | + $("#btn_bt_3").click(function(){ | ||
| 242 | + select_buffer_time("#btn_bt_3", 3); | ||
| 243 | + }); | ||
| 244 | + $("#btn_bt_5").click(function(){ | ||
| 245 | + select_buffer_time("#btn_bt_5", 5); | ||
| 246 | + }); | ||
| 247 | + $("#btn_bt_10").click(function(){ | ||
| 248 | + select_buffer_time("#btn_bt_10", 10); | ||
| 249 | + }); | ||
| 250 | + $("#btn_bt_30").click(function(){ | ||
| 251 | + select_buffer_time("#btn_bt_30", 30); | ||
| 252 | + }); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + var query = parse_query_string(); | ||
| 256 | + if (query.autostart == "true") { | ||
| 257 | + url = $("#txt_url").val(); | ||
| 258 | + $("#main_modal").modal({show:true, keyboard:false}); | ||
| 259 | + } | ||
| 260 | + }); | ||
| 261 | + </script> | ||
| 262 | +</head> | ||
| 263 | +<body> | ||
| 264 | +<div class="navbar navbar-fixed-top"> | ||
| 265 | + <div class="navbar-inner"> | ||
| 266 | + <div class="container"> | ||
| 267 | + <a class="brand" href="index.html">SRS</a> | ||
| 268 | + <div class="nav-collapse collapse"> | ||
| 269 | + <ul class="nav"> | ||
| 270 | + <li class="active"><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 271 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 272 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 273 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 274 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 275 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 276 | + </ul> | ||
| 277 | + </div> | ||
| 278 | + </div> | ||
| 279 | + </div> | ||
| 280 | +</div> | ||
| 281 | +<div class="container"> | ||
| 282 | + <div class="alert alert-info fade in"> | ||
| 283 | + <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 284 | + <strong><span>Usage:</span></strong> <span>输入RTMP/HTTP地址后点击“播放视频”即可播放视频</span> | ||
| 285 | + </div> | ||
| 286 | + <div class="form-inline"> | ||
| 287 | + URL: | ||
| 288 | + <input type="text" id="txt_url" class="input-xxlarge" value=""></input> | ||
| 289 | + <button class="btn btn-primary" id="btn_play">播放视频</button> | ||
| 290 | + </div> | ||
| 291 | + <div class="container"> | ||
| 292 | + <hr/> | ||
| 293 | + <span> | ||
| 294 | + 注意:必须按照<a href="https://github.com/winlinvip/simple-rtmp-server/blob/master/README.md">SRS README.md</a> | ||
| 295 | + 中的11个Step做完,下面所有的链接才能观看。 | ||
| 296 | + </span> | ||
| 297 | + <div class="accordion" id="main_accordion"> | ||
| 298 | + <div class="accordion-group"> | ||
| 299 | + <div class="accordion-heading"> | ||
| 300 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse1"> | ||
| 301 | + <strong>[1] SRS示例播放流: 原始流</strong> | ||
| 302 | + </span> | ||
| 303 | + </div> | ||
| 304 | + <div id="collapse1" class="accordion-body collapse"> | ||
| 305 | + <div class="accordion-inner"> | ||
| 306 | + <a href="#" id="srs_publish">rtmp://demo.srs.com/live/livestream</a> <br/> | ||
| 307 | + <span>用户推送过来的唯一一路流,经过服务器的多种变换和再转发。</span> | ||
| 308 | + </div> | ||
| 309 | + </div> | ||
| 310 | + </div> | ||
| 311 | + <div class="accordion-group"> | ||
| 312 | + <div class="accordion-heading"> | ||
| 313 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse10"> | ||
| 314 | + <strong>[2] SRS示例播放流: 原始流HLS</strong> | ||
| 315 | + </span> | ||
| 316 | + </div> | ||
| 317 | + <div id="collapse10" class="accordion-body collapse"> | ||
| 318 | + <div class="accordion-inner"> | ||
| 319 | + <a href="#" id="srs_publish_hls">http://demo.srs.com/live/livestream.m3u8</a> <br/> | ||
| 320 | + <span>对用户的流进行HLS切片(若编码为非H264/AAC,HLS流会自动禁用)。</span> | ||
| 321 | + </div> | ||
| 322 | + </div> | ||
| 323 | + </div> | ||
| 324 | + <div class="accordion-group"> | ||
| 325 | + <div class="accordion-heading"> | ||
| 326 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse2"> | ||
| 327 | + <strong>[3] SRS示例播放流: 转码配置LD流</strong> | ||
| 328 | + </span> | ||
| 329 | + </div> | ||
| 330 | + <div id="collapse2" class="accordion-body collapse"> | ||
| 331 | + <div class="accordion-inner"> | ||
| 332 | + <a href="#" id="srs_publish_ld">rtmp://demo.srs.com/live/livestream_ld</a> <br/> | ||
| 333 | + <span>对原始流加了<a href="http://ffmpeg.org/ffmpeg-filters.html#drawtext-1">FFMPEG文字水印</a></span> | ||
| 334 | + </div> | ||
| 335 | + </div> | ||
| 336 | + </div> | ||
| 337 | + <div class="accordion-group"> | ||
| 338 | + <div class="accordion-heading"> | ||
| 339 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse11"> | ||
| 340 | + <strong>[4] SRS示例播放流: 转码配置LD流HLS</strong> | ||
| 341 | + </span> | ||
| 342 | + </div> | ||
| 343 | + <div id="collapse11" class="accordion-body collapse"> | ||
| 344 | + <div class="accordion-inner"> | ||
| 345 | + <a href="#" id="srs_publish_ld_hls">http://demo.srs.com/live/livestream_ld.m3u8</a> <br/> | ||
| 346 | + <span>对转码配置LD流进行HLS切片。</span> | ||
| 347 | + </div> | ||
| 348 | + </div> | ||
| 349 | + </div> | ||
| 350 | + <div class="accordion-group"> | ||
| 351 | + <div class="accordion-heading"> | ||
| 352 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse3"> | ||
| 353 | + <strong>[5] SRS示例播放流: 转码配置SD流</strong> | ||
| 354 | + </span> | ||
| 355 | + </div> | ||
| 356 | + <div id="collapse3" class="accordion-body collapse"> | ||
| 357 | + <div class="accordion-inner"> | ||
| 358 | + <a href="#" id="srs_publish_sd">rtmp://demo.srs.com/live/livestream_sd</a> <br/> | ||
| 359 | + <span>对原始流应用了<a href="http://ffmpeg.org/ffmpeg-filters.html#Filtering-Introduction">FFMPEG翻转滤镜</a></span> | ||
| 360 | + </div> | ||
| 361 | + </div> | ||
| 362 | + </div> | ||
| 363 | + <div class="accordion-group"> | ||
| 364 | + <div class="accordion-heading"> | ||
| 365 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse12"> | ||
| 366 | + <strong>[6] SRS示例播放流: 转码配置SD流HLS</strong> | ||
| 367 | + </span> | ||
| 368 | + </div> | ||
| 369 | + <div id="collapse12" class="accordion-body collapse"> | ||
| 370 | + <div class="accordion-inner"> | ||
| 371 | + <a href="#" id="srs_publish_sd_hls">http://demo.srs.com/live/livestream_sd.m3u8</a> <br/> | ||
| 372 | + <span>对转码配置SD流进行HLS切片。</span> | ||
| 373 | + </div> | ||
| 374 | + </div> | ||
| 375 | + </div> | ||
| 376 | + <div class="accordion-group"> | ||
| 377 | + <div class="accordion-heading"> | ||
| 378 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse4"> | ||
| 379 | + <strong>[7] SRS示例播放流: 转发原始流</strong> | ||
| 380 | + </span> | ||
| 381 | + </div> | ||
| 382 | + <div id="collapse4" class="accordion-body collapse"> | ||
| 383 | + <div class="accordion-inner"> | ||
| 384 | + <a href="#" id="srs_publish_fw">rtmp://demo.srs.com:19350/live/livestream</a> <br/> | ||
| 385 | + <span>将用户推送的流转发到另外的vhost或服务器,做热备用。</span> | ||
| 386 | + </div> | ||
| 387 | + </div> | ||
| 388 | + </div> | ||
| 389 | + <div class="accordion-group"> | ||
| 390 | + <div class="accordion-heading"> | ||
| 391 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse13"> | ||
| 392 | + <strong>[8] SRS示例播放流: 转发原始流HLS</strong> | ||
| 393 | + </span> | ||
| 394 | + </div> | ||
| 395 | + <div id="collapse13" class="accordion-body collapse"> | ||
| 396 | + <div class="accordion-inner"> | ||
| 397 | + <a href="#" id="srs_publish_fw_hls">http://demo.srs.com/forward/live/livestream.m3u8</a> <br/> | ||
| 398 | + <span>对转发原始流进行HLS切片(若编码为非H264/AAC,HLS流会自动禁用)。</span> | ||
| 399 | + </div> | ||
| 400 | + </div> | ||
| 401 | + </div> | ||
| 402 | + <div class="accordion-group"> | ||
| 403 | + <div class="accordion-heading"> | ||
| 404 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse5"> | ||
| 405 | + <strong>[9] SRS示例播放流: 转发转码配置LD流</strong> | ||
| 406 | + </span> | ||
| 407 | + </div> | ||
| 408 | + <div id="collapse5" class="accordion-body collapse"> | ||
| 409 | + <div class="accordion-inner"> | ||
| 410 | + <a href="#" id="srs_publish_fw_ld">rtmp://demo.srs.com:19350/live/livestream_ld</a> <br/> | ||
| 411 | + <span>FFMPEG加水印后的流也会自动转发。</span> | ||
| 412 | + </div> | ||
| 413 | + </div> | ||
| 414 | + </div> | ||
| 415 | + <div class="accordion-group"> | ||
| 416 | + <div class="accordion-heading"> | ||
| 417 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse14"> | ||
| 418 | + <strong>[10] SRS示例播放流: 转发转码配置LD流HLS</strong> | ||
| 419 | + </span> | ||
| 420 | + </div> | ||
| 421 | + <div id="collapse14" class="accordion-body collapse"> | ||
| 422 | + <div class="accordion-inner"> | ||
| 423 | + <a href="#" id="srs_publish_fw_ld_hls">http://demo.srs.com/forward/live/livestream_ld.m3u8</a> <br/> | ||
| 424 | + <span>对转发转码配置LD流进行HLS切片,所有转发的流会自动支持HLS。</span> | ||
| 425 | + </div> | ||
| 426 | + </div> | ||
| 427 | + </div> | ||
| 428 | + <div class="accordion-group"> | ||
| 429 | + <div class="accordion-heading"> | ||
| 430 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse6"> | ||
| 431 | + <strong>[11] SRS示例播放流: 转发转码配置SD流</strong> | ||
| 432 | + </span> | ||
| 433 | + </div> | ||
| 434 | + <div id="collapse6" class="accordion-body collapse"> | ||
| 435 | + <div class="accordion-inner"> | ||
| 436 | + <a href="#" id="srs_publish_fw_sd">rtmp://demo.srs.com:19350/live/livestream_sd</a> <br/> | ||
| 437 | + <span>FFMPEG翻转后的流也会自动转发。</span> | ||
| 438 | + </div> | ||
| 439 | + </div> | ||
| 440 | + </div> | ||
| 441 | + <div class="accordion-group"> | ||
| 442 | + <div class="accordion-heading"> | ||
| 443 | + <span class="accordion-toggle" data-toggle="collapse" data-parent="#main_accordion" href="#collapse15"> | ||
| 444 | + <strong>[12] SRS示例播放流: 转发转码配置SD流HLS</strong> | ||
| 445 | + </span> | ||
| 446 | + </div> | ||
| 447 | + <div id="collapse15" class="accordion-body collapse"> | ||
| 448 | + <div class="accordion-inner"> | ||
| 449 | + <a href="#" id="srs_publish_fw_sd_hls">http://demo.srs.com/forward/live/livestream_sd.m3u8</a> <br/> | ||
| 450 | + <span>对转发转码配置SD流进行HLS切片,所有转发的流会自动支持HLS。</span> | ||
| 451 | + </div> | ||
| 452 | + </div> | ||
| 453 | + </div> | ||
| 454 | + </div> | ||
| 455 | + </div> | ||
| 456 | + <div id="main_modal" class="modal hide fade"> | ||
| 457 | + <div class="modal-header"> | ||
| 458 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 459 | + <h3><a href="https://github.com/winlinvip/simple-rtmp-server">SrsPlayer</a></h3> | ||
| 460 | + </div> | ||
| 461 | + <div class="modal-body"> | ||
| 462 | + <div id="player"></div> | ||
| 463 | + <div class="progress progress-striped active" id="pb_buffer_bg"> | ||
| 464 | + <div class="bar" style="width: 0%;" id="pb_buffer"></div> | ||
| 465 | + </div> | ||
| 466 | + </div> | ||
| 467 | + <div class="modal-footer" id="my_modal_footer"> | ||
| 468 | + <div class="input-prepend" id="div_play_time"> | ||
| 469 | + <span class="add-on" title="播放时长">@T</span> | ||
| 470 | + <input class="span2" style="width:85px" id="txt_time" type="text" placeholder="天 时:分:秒"> | ||
| 471 | + </div> | ||
| 472 | + <div class="btn-group dropup"> | ||
| 473 | + <button class="btn dropdown-toggle" data-toggle="dropdown"> | ||
| 474 | + <a id="fs_tips" href="#" data-toggle="tooltip" data-placement="top" title=""> | ||
| 475 | + <img src="img/tooltip.png"/> | ||
| 476 | + </a> | ||
| 477 | + 全屏大小<span class="caret"></span> | ||
| 478 | + </button> | ||
| 479 | + <ul class="dropdown-menu"> | ||
| 480 | + <li><a id="btn_fs_size_screen_100" href="#">屏幕大小(100%)</a></li> | ||
| 481 | + <li><a id="btn_fs_size_screen_75" href="#">屏幕大小(75%)</a></li> | ||
| 482 | + <li><a id="btn_fs_size_screen_50" href="#">屏幕大小(50%)</a></li> | ||
| 483 | + <li><a id="btn_fs_size_video_100" href="#">视频大小(100%)</a></li> | ||
| 484 | + <li><a id="btn_fs_size_video_75" href="#">视频大小(75%)</a></li> | ||
| 485 | + <li><a id="btn_fs_size_video_50" href="#">视频大小(50%)</a></li> | ||
| 486 | + </ul> | ||
| 487 | + </div> | ||
| 488 | + <div class="btn-group dropup"> | ||
| 489 | + <button class="btn dropdown-toggle" data-toggle="dropdown">显示比例<span class="caret"></span></button> | ||
| 490 | + <ul class="dropdown-menu"> | ||
| 491 | + <li><a id="btn_dar_original" href="#">视频原始比例</a></li> | ||
| 492 | + <li><a id="btn_dar_21_9" href="#">宽屏影院(21:9)</a></li> | ||
| 493 | + <li><a id="btn_dar_16_9" href="#">宽屏电视(16:9)</a></li> | ||
| 494 | + <li><a id="btn_dar_4_3" href="#">窄屏(4:3)</a></li> | ||
| 495 | + <li><a id="btn_dar_fill" href="#">填充(容器比例)</a></li> | ||
| 496 | + </ul> | ||
| 497 | + </div> | ||
| 498 | + <div class="btn-group dropup"> | ||
| 499 | + <button class="btn dropdown-toggle" data-toggle="dropdown">缓冲区<span class="caret"></span></button> | ||
| 500 | + <ul class="dropdown-menu"> | ||
| 501 | + <li><a id="btn_bt_0_5" href="#">0.5秒(实时)</a></li> | ||
| 502 | + <li><a id="btn_bt_0_8" href="#">0.8秒(会议)</a></li> | ||
| 503 | + <li><a id="btn_bt_1" href="#">1秒(低延迟)</a></li> | ||
| 504 | + <li><a id="btn_bt_2" href="#">2秒(较低延时)</a></li> | ||
| 505 | + <li><a id="btn_bt_3" href="#">3秒(流畅播放)</a></li> | ||
| 506 | + <li><a id="btn_bt_5" href="#">5秒(网速较低)</a></li> | ||
| 507 | + <li><a id="btn_bt_10" href="#">10秒(无所谓延迟)</a></li> | ||
| 508 | + <li><a id="btn_bt_30" href="#">30秒(流畅第一)</a></li> | ||
| 509 | + </ul> | ||
| 510 | + </div> | ||
| 511 | + <div class="btn-group dropup"> | ||
| 512 | + <button id="btn_pause" class="btn">暂停</button> | ||
| 513 | + </div> | ||
| 514 | + <div class="btn-group dropup"> | ||
| 515 | + <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">关闭</button> | ||
| 516 | + </div> | ||
| 517 | + </div> | ||
| 518 | + </div> | ||
| 519 | + <footer> | ||
| 520 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 521 | + </footer> | ||
| 522 | +</div> | ||
| 523 | +</body> |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | +<actionScriptProperties analytics="false" mainApplicationPath="srs_player.as" projectUUID="1bb41a0e-6b1f-49b5-8603-219442f9f9b3" version="10"> | ||
| 3 | + <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="false" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="release" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> | ||
| 4 | + <compilerSourcePath/> | ||
| 5 | + <libraryPath defaultLinkType="0"> | ||
| 6 | + <libraryPathEntry kind="4" path=""> | ||
| 7 | + <excludedEntries> | ||
| 8 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/> | ||
| 9 | + <libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/> | ||
| 10 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc" useDefaultLinkType="false"/> | ||
| 11 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/> | ||
| 12 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/> | ||
| 13 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/> | ||
| 14 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/> | ||
| 15 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/mx/mx.swc" useDefaultLinkType="false"/> | ||
| 16 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/> | ||
| 17 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/> | ||
| 18 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/> | ||
| 19 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/> | ||
| 20 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/> | ||
| 21 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/> | ||
| 22 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/> | ||
| 23 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/> | ||
| 24 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> | ||
| 25 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/> | ||
| 26 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> | ||
| 27 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/> | ||
| 28 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/> | ||
| 29 | + </excludedEntries> | ||
| 30 | + </libraryPathEntry> | ||
| 31 | + </libraryPath> | ||
| 32 | + <sourceAttachmentPath/> | ||
| 33 | + </compiler> | ||
| 34 | + <applications> | ||
| 35 | + <application path="srs_player.as"/> | ||
| 36 | + </applications> | ||
| 37 | + <modules/> | ||
| 38 | + <buildCSSFiles/> | ||
| 39 | + <flashCatalyst validateFlashCatalystCompatibility="false"/> | ||
| 40 | +</actionScriptProperties> |
trunk/research/players/srs_player/.project
0 → 100755
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<projectDescription> | ||
| 3 | + <name>srs_player</name> | ||
| 4 | + <comment></comment> | ||
| 5 | + <projects> | ||
| 6 | + </projects> | ||
| 7 | + <buildSpec> | ||
| 8 | + <buildCommand> | ||
| 9 | + <name>com.adobe.flexbuilder.project.flexbuilder</name> | ||
| 10 | + <arguments> | ||
| 11 | + </arguments> | ||
| 12 | + </buildCommand> | ||
| 13 | + </buildSpec> | ||
| 14 | + <natures> | ||
| 15 | + <nature>com.adobe.flexbuilder.project.actionscriptnature</nature> | ||
| 16 | + </natures> | ||
| 17 | +</projectDescription> |
不能预览此文件类型
| 1 | +package | ||
| 2 | +{ | ||
| 3 | + import flash.display.Sprite; | ||
| 4 | + import flash.display.StageAlign; | ||
| 5 | + import flash.display.StageDisplayState; | ||
| 6 | + import flash.display.StageScaleMode; | ||
| 7 | + import flash.events.Event; | ||
| 8 | + import flash.events.FullScreenEvent; | ||
| 9 | + import flash.events.MouseEvent; | ||
| 10 | + import flash.events.NetStatusEvent; | ||
| 11 | + import flash.events.TimerEvent; | ||
| 12 | + import flash.external.ExternalInterface; | ||
| 13 | + import flash.media.Video; | ||
| 14 | + import flash.net.NetConnection; | ||
| 15 | + import flash.net.NetStream; | ||
| 16 | + import flash.system.Security; | ||
| 17 | + import flash.ui.ContextMenu; | ||
| 18 | + import flash.ui.ContextMenuItem; | ||
| 19 | + import flash.utils.Timer; | ||
| 20 | + import flash.utils.setTimeout; | ||
| 21 | + | ||
| 22 | + public class srs_player extends Sprite | ||
| 23 | + { | ||
| 24 | + // user set id. | ||
| 25 | + private var js_id:String = null; | ||
| 26 | + // user set callback | ||
| 27 | + private var js_on_player_ready:String = null; | ||
| 28 | + private var js_on_player_metadata:String = null; | ||
| 29 | + private var js_on_player_timer:String = null; | ||
| 30 | + | ||
| 31 | + // play param url. | ||
| 32 | + private var user_url:String = null; | ||
| 33 | + // play param, user set width and height | ||
| 34 | + private var user_w:int = 0; | ||
| 35 | + private var user_h:int = 0; | ||
| 36 | + // user set dar den:num | ||
| 37 | + private var user_dar_num:int = 0; | ||
| 38 | + private var user_dar_den:int = 0; | ||
| 39 | + // user set fs(fullscreen) refer and percent. | ||
| 40 | + private var user_fs_refer:String = null; | ||
| 41 | + private var user_fs_percent:int = 0; | ||
| 42 | + | ||
| 43 | + // media specified. | ||
| 44 | + private var media_conn:NetConnection = null; | ||
| 45 | + private var media_stream:NetStream = null; | ||
| 46 | + private var media_video:Video = null; | ||
| 47 | + private var media_metadata:Object = {}; | ||
| 48 | + private var media_timer:Timer = new Timer(300); | ||
| 49 | + | ||
| 50 | + // controls. | ||
| 51 | + // flash donot allow js to set to fullscreen, | ||
| 52 | + // only allow user click to enter fullscreen. | ||
| 53 | + private var control_fs_mask:Sprite = new Sprite(); | ||
| 54 | + | ||
| 55 | + public function srs_player() | ||
| 56 | + { | ||
| 57 | + if (!this.stage) { | ||
| 58 | + this.addEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); | ||
| 59 | + } else { | ||
| 60 | + this.system_on_add_to_stage(null); | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + /** | ||
| 65 | + * system event callback, when this control added to stage. | ||
| 66 | + * the main function. | ||
| 67 | + */ | ||
| 68 | + private function system_on_add_to_stage(evt:Event):void { | ||
| 69 | + this.removeEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); | ||
| 70 | + | ||
| 71 | + this.stage.align = StageAlign.TOP_LEFT; | ||
| 72 | + this.stage.scaleMode = StageScaleMode.NO_SCALE; | ||
| 73 | + | ||
| 74 | + this.stage.addEventListener(FullScreenEvent.FULL_SCREEN, this.user_on_stage_fullscreen); | ||
| 75 | + | ||
| 76 | + this.addChild(this.control_fs_mask); | ||
| 77 | + this.control_fs_mask.buttonMode = true; | ||
| 78 | + this.control_fs_mask.addEventListener(MouseEvent.CLICK, user_on_click_video); | ||
| 79 | + | ||
| 80 | + this.contextMenu = new ContextMenu(); | ||
| 81 | + this.contextMenu.hideBuiltInItems(); | ||
| 82 | + | ||
| 83 | + var flashvars:Object = this.root.loaderInfo.parameters; | ||
| 84 | + | ||
| 85 | + if (!flashvars.hasOwnProperty("id")) { | ||
| 86 | + throw new Error("must specifies the id"); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + this.js_id = flashvars.id; | ||
| 90 | + this.js_on_player_ready = flashvars.on_player_ready; | ||
| 91 | + this.js_on_player_metadata = flashvars.on_player_metadata; | ||
| 92 | + this.js_on_player_timer = flashvars.on_player_timer; | ||
| 93 | + | ||
| 94 | + this.media_timer.addEventListener(TimerEvent.TIMER, this.system_on_timer); | ||
| 95 | + this.media_timer.start(); | ||
| 96 | + | ||
| 97 | + flash.utils.setTimeout(this.system_on_js_ready, 0); | ||
| 98 | + } | ||
| 99 | + | ||
| 100 | + /** | ||
| 101 | + * system callack event, when js ready, register callback for js. | ||
| 102 | + * the actual main function. | ||
| 103 | + */ | ||
| 104 | + private function system_on_js_ready():void { | ||
| 105 | + if (!flash.external.ExternalInterface.available) { | ||
| 106 | + trace("js not ready, try later."); | ||
| 107 | + flash.utils.setTimeout(this.system_on_js_ready, 100); | ||
| 108 | + return; | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + flash.external.ExternalInterface.addCallback("__play", this.js_call_play); | ||
| 112 | + flash.external.ExternalInterface.addCallback("__stop", this.js_call_stop); | ||
| 113 | + flash.external.ExternalInterface.addCallback("__pause", this.js_call_pause); | ||
| 114 | + flash.external.ExternalInterface.addCallback("__resume", this.js_call_resume); | ||
| 115 | + flash.external.ExternalInterface.addCallback("__dar", this.js_call_dar); | ||
| 116 | + flash.external.ExternalInterface.addCallback("__set_fs", this.js_call_set_fs_size); | ||
| 117 | + flash.external.ExternalInterface.addCallback("__set_bt", this.js_call_set_bt); | ||
| 118 | + | ||
| 119 | + flash.external.ExternalInterface.call(this.js_on_player_ready, this.js_id); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + /** | ||
| 123 | + * system callack event, timer to do some regular tasks. | ||
| 124 | + */ | ||
| 125 | + private function system_on_timer(evt:TimerEvent):void { | ||
| 126 | + if (!this.media_stream) { | ||
| 127 | + trace("stream is null, ignore timer event."); | ||
| 128 | + return; | ||
| 129 | + } | ||
| 130 | + | ||
| 131 | + trace("notify js the timer event."); | ||
| 132 | + flash.external.ExternalInterface.call( | ||
| 133 | + this.js_on_player_timer, this.js_id, this.media_stream.time, this.media_stream.bufferLength); | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + /** | ||
| 137 | + * system callack event, when got metadata from stream. | ||
| 138 | + * or got video dimension change event(the DAR notification), to update the metadata manually. | ||
| 139 | + */ | ||
| 140 | + private function system_on_metadata(metadata:Object):void { | ||
| 141 | + this.media_metadata = metadata; | ||
| 142 | + | ||
| 143 | + if (metadata.hasOwnProperty("server")) { | ||
| 144 | + // for context menu | ||
| 145 | + var customItems:Array = [new ContextMenuItem("SrsPlayer")]; | ||
| 146 | + if (metadata.hasOwnProperty("server")) { | ||
| 147 | + customItems.push(new ContextMenuItem("Server: " + metadata.server)); | ||
| 148 | + } | ||
| 149 | + if (metadata.hasOwnProperty("contributor")) { | ||
| 150 | + customItems.push(new ContextMenuItem("Contributor: " + metadata.contributor)); | ||
| 151 | + } | ||
| 152 | + contextMenu.customItems = customItems; | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + // for js. | ||
| 156 | + var obj:Object = __get_video_size_object(); | ||
| 157 | + | ||
| 158 | + obj.server = 'srs'; | ||
| 159 | + obj.contributor = 'winlin'; | ||
| 160 | + | ||
| 161 | + if (metadata.hasOwnProperty("server")) { | ||
| 162 | + obj.server = metadata.server; | ||
| 163 | + } | ||
| 164 | + if (metadata.hasOwnProperty("contributor")) { | ||
| 165 | + obj.contributor = metadata.contributor; | ||
| 166 | + } | ||
| 167 | + | ||
| 168 | + var code:int = flash.external.ExternalInterface.call(js_on_player_metadata, js_id, obj); | ||
| 169 | + if (code != 0) { | ||
| 170 | + throw new Error("callback on_player_metadata failed. code=" + code); | ||
| 171 | + } | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + /** | ||
| 175 | + * player callack event, when user click video to enter or leave fullscreen. | ||
| 176 | + */ | ||
| 177 | + private function user_on_stage_fullscreen(evt:FullScreenEvent):void { | ||
| 178 | + if (!evt.fullScreen) { | ||
| 179 | + __execute_user_set_dar(); | ||
| 180 | + } else { | ||
| 181 | + __execute_user_enter_fullscreen(); | ||
| 182 | + } | ||
| 183 | + } | ||
| 184 | + | ||
| 185 | + /** | ||
| 186 | + * user event callback, js cannot enter the fullscreen mode, user must click to. | ||
| 187 | + */ | ||
| 188 | + private function user_on_click_video(evt:MouseEvent):void { | ||
| 189 | + if (!this.stage.allowsFullScreen) { | ||
| 190 | + trace("donot allow fullscreen."); | ||
| 191 | + return; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + // enter fullscreen to get the fullscreen size correctly. | ||
| 195 | + if (this.stage.displayState == StageDisplayState.FULL_SCREEN) { | ||
| 196 | + this.stage.displayState = StageDisplayState.NORMAL; | ||
| 197 | + } else { | ||
| 198 | + this.stage.displayState = StageDisplayState.FULL_SCREEN; | ||
| 199 | + } | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + /** | ||
| 203 | + * function for js to call: to pause the stream. ignore if not play. | ||
| 204 | + */ | ||
| 205 | + private function js_call_pause():void { | ||
| 206 | + if (this.media_stream) { | ||
| 207 | + this.media_stream.pause(); | ||
| 208 | + } | ||
| 209 | + } | ||
| 210 | + | ||
| 211 | + /** | ||
| 212 | + * function for js to call: to resume the stream. ignore if not play. | ||
| 213 | + */ | ||
| 214 | + private function js_call_resume():void { | ||
| 215 | + if (this.media_stream) { | ||
| 216 | + this.media_stream.resume(); | ||
| 217 | + } | ||
| 218 | + } | ||
| 219 | + | ||
| 220 | + /** | ||
| 221 | + * to set the DAR, for example, DAR=16:9 | ||
| 222 | + * @param num, for example, 9. | ||
| 223 | + * use metadata height if 0. | ||
| 224 | + * use user specified height if -1. | ||
| 225 | + * @param den, for example, 16. | ||
| 226 | + * use metadata width if 0. | ||
| 227 | + * use user specified width if -1. | ||
| 228 | + */ | ||
| 229 | + private function js_call_dar(num:int, den:int):void { | ||
| 230 | + user_dar_num = num; | ||
| 231 | + user_dar_den = den; | ||
| 232 | + | ||
| 233 | + flash.utils.setTimeout(__execute_user_set_dar, 0); | ||
| 234 | + } | ||
| 235 | + | ||
| 236 | + /** | ||
| 237 | + * set the fullscreen size data. | ||
| 238 | + * @refer the refer fullscreen mode. it can be: | ||
| 239 | + * video: use video orignal size. | ||
| 240 | + * screen: use screen size to rescale video. | ||
| 241 | + * @param percent, the rescale percent, where | ||
| 242 | + * 100 means 100%. | ||
| 243 | + */ | ||
| 244 | + private function js_call_set_fs_size(refer:String, percent:int):void { | ||
| 245 | + user_fs_refer = refer; | ||
| 246 | + user_fs_percent = percent; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + /** | ||
| 250 | + * set the stream buffer time in seconds. | ||
| 251 | + * @buffer_time the buffer time in seconds. | ||
| 252 | + */ | ||
| 253 | + private function js_call_set_bt(buffer_time:Number):void { | ||
| 254 | + if (this.media_stream) { | ||
| 255 | + this.media_stream.bufferTime = buffer_time; | ||
| 256 | + } | ||
| 257 | + } | ||
| 258 | + | ||
| 259 | + /** | ||
| 260 | + * function for js to call: to stop the stream. ignore if not play. | ||
| 261 | + */ | ||
| 262 | + private function js_call_stop():void { | ||
| 263 | + if (this.media_video) { | ||
| 264 | + this.removeChild(this.media_video); | ||
| 265 | + this.media_video = null; | ||
| 266 | + } | ||
| 267 | + if (this.media_stream) { | ||
| 268 | + this.media_stream.close(); | ||
| 269 | + this.media_stream = null; | ||
| 270 | + } | ||
| 271 | + if (this.media_conn) { | ||
| 272 | + this.media_conn.close(); | ||
| 273 | + this.media_conn = null; | ||
| 274 | + } | ||
| 275 | + } | ||
| 276 | + | ||
| 277 | + /** | ||
| 278 | + * function for js to call: to play the stream. stop then play. | ||
| 279 | + * @param url, the rtmp/http url to play. | ||
| 280 | + * @param _width, the player width. | ||
| 281 | + * @param _height, the player height. | ||
| 282 | + * @param buffer_time, the buffer time in seconds. recommend to >=0.5 | ||
| 283 | + */ | ||
| 284 | + private function js_call_play(url:String, _width:int, _height:int, buffer_time:Number):void { | ||
| 285 | + this.user_url = url; | ||
| 286 | + this.user_w = _width; | ||
| 287 | + this.user_h = _height; | ||
| 288 | + trace("start to play url: " + this.user_url + ", w=" + this.user_w + ", h=" + this.user_h); | ||
| 289 | + | ||
| 290 | + js_call_stop(); | ||
| 291 | + | ||
| 292 | + this.media_conn = new NetConnection(); | ||
| 293 | + this.media_conn.client = {}; | ||
| 294 | + this.media_conn.client.onBWDone = function():void {}; | ||
| 295 | + this.media_conn.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void { | ||
| 296 | + trace ("NetConnection: code=" + evt.info.code); | ||
| 297 | + | ||
| 298 | + if (evt.info.hasOwnProperty("data") && evt.info.data) { | ||
| 299 | + // for context menu | ||
| 300 | + var customItems:Array = [new ContextMenuItem("SrsPlayer")]; | ||
| 301 | + if (evt.info.data.hasOwnProperty("srs_server")) { | ||
| 302 | + customItems.push(new ContextMenuItem("Server: " + evt.info.data.srs_server)); | ||
| 303 | + } | ||
| 304 | + if (evt.info.data.hasOwnProperty("srs_contributor")) { | ||
| 305 | + customItems.push(new ContextMenuItem("Contributor: " + evt.info.data.srs_contributor)); | ||
| 306 | + } | ||
| 307 | + contextMenu.customItems = customItems; | ||
| 308 | + } | ||
| 309 | + | ||
| 310 | + // TODO: FIXME: failed event. | ||
| 311 | + if (evt.info.code != "NetConnection.Connect.Success") { | ||
| 312 | + return; | ||
| 313 | + } | ||
| 314 | + | ||
| 315 | + media_stream = new NetStream(media_conn); | ||
| 316 | + media_stream.bufferTime = buffer_time; | ||
| 317 | + media_stream.client = {}; | ||
| 318 | + media_stream.client.onMetaData = system_on_metadata; | ||
| 319 | + media_stream.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void { | ||
| 320 | + trace ("NetStream: code=" + evt.info.code); | ||
| 321 | + | ||
| 322 | + if (evt.info.code == "NetStream.Video.DimensionChange") { | ||
| 323 | + system_on_metadata(media_metadata); | ||
| 324 | + } | ||
| 325 | + | ||
| 326 | + // TODO: FIXME: failed event. | ||
| 327 | + }); | ||
| 328 | + | ||
| 329 | + if (url.indexOf("http") == 0) { | ||
| 330 | + media_stream.play(url); | ||
| 331 | + } else { | ||
| 332 | + var streamName:String = url.substr(url.lastIndexOf("/")); | ||
| 333 | + media_stream.play(streamName); | ||
| 334 | + } | ||
| 335 | + | ||
| 336 | + media_video = new Video(); | ||
| 337 | + media_video.width = _width; | ||
| 338 | + media_video.height = _height; | ||
| 339 | + media_video.attachNetStream(media_stream); | ||
| 340 | + media_video.smoothing = true; | ||
| 341 | + addChild(media_video); | ||
| 342 | + | ||
| 343 | + __draw_black_background(_width, _height); | ||
| 344 | + | ||
| 345 | + // lowest layer, for mask to cover it. | ||
| 346 | + setChildIndex(media_video, 0); | ||
| 347 | + }); | ||
| 348 | + | ||
| 349 | + if (url.indexOf("http") == 0) { | ||
| 350 | + this.media_conn.connect(null); | ||
| 351 | + } else { | ||
| 352 | + var tcUrl:String = this.user_url.substr(0, this.user_url.lastIndexOf("/")); | ||
| 353 | + this.media_conn.connect(tcUrl); | ||
| 354 | + } | ||
| 355 | + } | ||
| 356 | + | ||
| 357 | + /** | ||
| 358 | + * get the "right" size of video, | ||
| 359 | + * 1. initialize with the original video object size. | ||
| 360 | + * 2. override with metadata size if specified. | ||
| 361 | + * 3. override with codec size if specified. | ||
| 362 | + */ | ||
| 363 | + private function __get_video_size_object():Object { | ||
| 364 | + var obj:Object = { | ||
| 365 | + width: media_video.width, | ||
| 366 | + height: media_video.height | ||
| 367 | + }; | ||
| 368 | + | ||
| 369 | + // override with metadata size. | ||
| 370 | + if (this.media_metadata.hasOwnProperty("width")) { | ||
| 371 | + obj.width = this.media_metadata.width; | ||
| 372 | + } | ||
| 373 | + if (this.media_metadata.hasOwnProperty("height")) { | ||
| 374 | + obj.height = this.media_metadata.height; | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + // override with codec size. | ||
| 378 | + if (media_video.videoWidth > 0) { | ||
| 379 | + obj.width = media_video.videoWidth; | ||
| 380 | + } | ||
| 381 | + if (media_video.videoHeight > 0) { | ||
| 382 | + obj.height = media_video.videoHeight; | ||
| 383 | + } | ||
| 384 | + | ||
| 385 | + return obj; | ||
| 386 | + } | ||
| 387 | + | ||
| 388 | + /** | ||
| 389 | + * execute the enter fullscreen action. | ||
| 390 | + */ | ||
| 391 | + private function __execute_user_enter_fullscreen():void { | ||
| 392 | + if (!user_fs_refer || user_fs_percent <= 0) { | ||
| 393 | + return; | ||
| 394 | + } | ||
| 395 | + | ||
| 396 | + // change to video size if refer to video. | ||
| 397 | + var obj:Object = __get_video_size_object(); | ||
| 398 | + | ||
| 399 | + // get the DAR | ||
| 400 | + var num:int = user_dar_num; | ||
| 401 | + var den:int = user_dar_den; | ||
| 402 | + | ||
| 403 | + if (num == 0) { | ||
| 404 | + num = obj.height; | ||
| 405 | + } | ||
| 406 | + if (num == -1) { | ||
| 407 | + num = this.stage.fullScreenHeight; | ||
| 408 | + } | ||
| 409 | + | ||
| 410 | + if (den == 0) { | ||
| 411 | + den = obj.width; | ||
| 412 | + } | ||
| 413 | + if (den == -1) { | ||
| 414 | + den = this.stage.fullScreenWidth; | ||
| 415 | + } | ||
| 416 | + | ||
| 417 | + // for refer is screen. | ||
| 418 | + if (user_fs_refer == "screen") { | ||
| 419 | + obj = { | ||
| 420 | + width: this.stage.fullScreenWidth, | ||
| 421 | + height: this.stage.fullScreenHeight | ||
| 422 | + }; | ||
| 423 | + } | ||
| 424 | + | ||
| 425 | + // rescale to fs | ||
| 426 | + __update_video_size(num, den, obj.width * user_fs_percent / 100, obj.height * user_fs_percent / 100, this.stage.fullScreenWidth, this.stage.fullScreenHeight); | ||
| 427 | + } | ||
| 428 | + | ||
| 429 | + /** | ||
| 430 | + * for user set dar, or leave fullscreen to recover the dar. | ||
| 431 | + */ | ||
| 432 | + private function __execute_user_set_dar():void { | ||
| 433 | + // get the DAR | ||
| 434 | + var num:int = user_dar_num; | ||
| 435 | + var den:int = user_dar_den; | ||
| 436 | + | ||
| 437 | + var obj:Object = __get_video_size_object(); | ||
| 438 | + | ||
| 439 | + if (num == 0) { | ||
| 440 | + num = obj.height; | ||
| 441 | + } | ||
| 442 | + if (num == -1) { | ||
| 443 | + num = this.user_h; | ||
| 444 | + } | ||
| 445 | + | ||
| 446 | + if (den == 0) { | ||
| 447 | + den = obj.width; | ||
| 448 | + } | ||
| 449 | + if (den == -1) { | ||
| 450 | + den = this.user_w; | ||
| 451 | + } | ||
| 452 | + | ||
| 453 | + __update_video_size(num, den, this.user_w, this.user_h, this.user_w, this.user_h); | ||
| 454 | + } | ||
| 455 | + | ||
| 456 | + /** | ||
| 457 | + * update the video width and height, | ||
| 458 | + * according to the specifies DAR(den:num) and max size(w:h). | ||
| 459 | + * set the position of video(x,y) specifies by size(sw:sh), | ||
| 460 | + * and update the bg to size(sw:sh). | ||
| 461 | + * @param _num/_den the DAR. use to rescale the player together with paper size. | ||
| 462 | + * @param _w/_h the video draw paper size. used to rescale the player together with DAR. | ||
| 463 | + * @param _sw/_wh the stage size, >= paper size. used to center the player. | ||
| 464 | + */ | ||
| 465 | + private function __update_video_size(_num:int, _den:int, _w:int, _h:int, _sw:int, _sh:int):void { | ||
| 466 | + if (!this.media_video || _num <= 0 || _den <= 0) { | ||
| 467 | + return; | ||
| 468 | + } | ||
| 469 | + | ||
| 470 | + // set DAR. | ||
| 471 | + // calc the height by DAR | ||
| 472 | + var _height:int = _w * _num / _den; | ||
| 473 | + if (_height <= _h) { | ||
| 474 | + this.media_video.width = _w; | ||
| 475 | + this.media_video.height = _height; | ||
| 476 | + } else { | ||
| 477 | + // height overflow, calc the width by DAR | ||
| 478 | + var _width:int = _h * _den / _num; | ||
| 479 | + | ||
| 480 | + this.media_video.width = _width; | ||
| 481 | + this.media_video.height = _h; | ||
| 482 | + } | ||
| 483 | + | ||
| 484 | + // align center. | ||
| 485 | + this.media_video.x = (_sw - this.media_video.width) / 2; | ||
| 486 | + this.media_video.y = (_sh - this.media_video.height) / 2; | ||
| 487 | + | ||
| 488 | + __draw_black_background(_sw, _sh); | ||
| 489 | + } | ||
| 490 | + | ||
| 491 | + /** | ||
| 492 | + * draw black background and draw the fullscreen mask. | ||
| 493 | + */ | ||
| 494 | + private function __draw_black_background(_width:int, _height:int):void { | ||
| 495 | + // draw black bg. | ||
| 496 | + this.graphics.beginFill(0x00, 1.0); | ||
| 497 | + this.graphics.drawRect(0, 0, _width, _height); | ||
| 498 | + this.graphics.endFill(); | ||
| 499 | + | ||
| 500 | + // draw the fs mask. | ||
| 501 | + this.control_fs_mask.graphics.beginFill(0xff0000, 0); | ||
| 502 | + this.control_fs_mask.graphics.drawRect(0, 0, _width, _height); | ||
| 503 | + this.control_fs_mask.graphics.endFill(); | ||
| 504 | + } | ||
| 505 | + } | ||
| 506 | +} |
trunk/research/players/srs_publisher.html
0 → 100755
| 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + </style> | ||
| 16 | + <script type="text/javascript"> | ||
| 17 | + var srs_publisher = null; | ||
| 18 | + var remote_player = null; | ||
| 19 | + var realtime_player = null; | ||
| 20 | + | ||
| 21 | + $(function(){ | ||
| 22 | + // get the vhost and port to set the default url. | ||
| 23 | + // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo | ||
| 24 | + // url set to: rtmp://demo:1935/live/livestream | ||
| 25 | + srs_init("#txt_url", null, null); | ||
| 26 | + | ||
| 27 | + $("#btn_video_settings").click(function(){ | ||
| 28 | + $("#video_modal").modal({show:true}); | ||
| 29 | + }); | ||
| 30 | + $("#btn_audio_settings").click(function(){ | ||
| 31 | + $("#audio_modal").modal({show:true}); | ||
| 32 | + }); | ||
| 33 | + | ||
| 34 | + $("#remote_tips").tooltip({ | ||
| 35 | + title: "为了支持HLS输出,FLASH编码器输出的流需要经过转码(VP6=>H264,MP3=>aac),所以会黑屏较长时间,请耐心等待" | ||
| 36 | + }); | ||
| 37 | + $("#low_latecy_tips").tooltip({ | ||
| 38 | + title: "服务器不转码直接转发FLASH编码器的流,所以延迟比支持HLS的流要低很多" | ||
| 39 | + }); | ||
| 40 | + | ||
| 41 | + $("#btn_publish").click(on_user_publish); | ||
| 42 | + | ||
| 43 | + // for publish, we use randome stream name. | ||
| 44 | + $("#txt_url").val($("#txt_url").val() + "." + new Date().getTime()); | ||
| 45 | + | ||
| 46 | + // start the publisher. | ||
| 47 | + srs_publisher = new SrsPublisher("local_publisher", 430, 185); | ||
| 48 | + srs_publisher.on_publisher_ready = function(cameras, microphones) { | ||
| 49 | + $("#sl_cameras").empty(); | ||
| 50 | + for (var i = 0; i < cameras.length; i++) { | ||
| 51 | + $("#sl_cameras").append("<option value='" + i + "'>" + cameras[i] + "</option"); | ||
| 52 | + } | ||
| 53 | + // optional: select the first no "virtual" signed. | ||
| 54 | + for (var i = 0; i < cameras.length; i++) { | ||
| 55 | + if (cameras[i].toLowerCase().indexOf("virtual") == -1) { | ||
| 56 | + $("#sl_cameras option[value='" + i + "']").attr("selected", true); | ||
| 57 | + break; | ||
| 58 | + } | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + $("#sl_microphones").empty(); | ||
| 62 | + for (var i = 0; i < microphones.length; i++) { | ||
| 63 | + $("#sl_microphones").append("<option value='" + i + "'>" + microphones[i] + "</option"); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + $("#sl_vcodec").empty(); | ||
| 67 | + var vcodecs = ["h264", "vp6"]; | ||
| 68 | + for (var i = 0; i < vcodecs.length; i++) { | ||
| 69 | + $("#sl_vcodec").append("<option value='" + vcodecs[i] + "'>" + vcodecs[i] + "</option"); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + $("#sl_profile").empty(); | ||
| 73 | + var profiles = ["baseline", "main"]; | ||
| 74 | + for (var i = 0; i < profiles.length; i++) { | ||
| 75 | + $("#sl_profile").append("<option value='" + profiles[i] + "'>" + profiles[i] + "</option"); | ||
| 76 | + } | ||
| 77 | + | ||
| 78 | + $("#sl_level").empty(); | ||
| 79 | + var levels = ["1", "1b", "1.1", "1.2", "1.3", | ||
| 80 | + "2", "2.1", "2.2", "3", "3.1", "3.2", "4", "4.1", "4.2", "5", "5.1"]; | ||
| 81 | + for (var i = 0; i < levels.length; i++) { | ||
| 82 | + $("#sl_level").append("<option value='" + levels[i] + "'>" + levels[i] + "</option"); | ||
| 83 | + } | ||
| 84 | + $("#sl_level option[value='4.1']").attr("selected", true); | ||
| 85 | + | ||
| 86 | + $("#sl_gop").empty(); | ||
| 87 | + var gops = ["0.3", "0.5", "1", "2", "3", "4", | ||
| 88 | + "5", "6", "7", "8", "9", "10", "15", "20"]; | ||
| 89 | + for (var i = 0; i < gops.length; i++) { | ||
| 90 | + $("#sl_gop").append("<option value='" + gops[i] + "'>" + gops[i] + "秒</option"); | ||
| 91 | + } | ||
| 92 | + $("#sl_gop option[value='5']").attr("selected", true); | ||
| 93 | + | ||
| 94 | + $("#sl_size").empty(); | ||
| 95 | + var sizes = ["176x144", "320x240", "352x240", | ||
| 96 | + "352x288", "460x240", "640x480", "720x480", "720x576", "800x600", | ||
| 97 | + "1024x768", "1280x720", "1360x768", "1920x1080"]; | ||
| 98 | + for (i = 0; i < sizes.length; i++) { | ||
| 99 | + $("#sl_size").append("<option value='" + sizes[i] + "'>" + sizes[i] + "</option"); | ||
| 100 | + } | ||
| 101 | + $("#sl_size option[value='460x240']").attr("selected", true); | ||
| 102 | + | ||
| 103 | + $("#sl_fps").empty(); | ||
| 104 | + var fpses = ["5", "10", "15", "20", "24", "25", "29.97", "30"]; | ||
| 105 | + for (i = 0; i < fpses.length; i++) { | ||
| 106 | + $("#sl_fps").append("<option value='" + fpses[i] + "'>" + Number(fpses[i]).toFixed(2) + " 帧/秒</option"); | ||
| 107 | + } | ||
| 108 | + $("#sl_fps option[value='15']").attr("selected", true); | ||
| 109 | + | ||
| 110 | + $("#sl_bitrate").empty(); | ||
| 111 | + var bitrates = ["50", "200", "350", "500", "650", "800", | ||
| 112 | + "950", "1000", "1200", "1500", "1800", "2000", "3000", "5000"]; | ||
| 113 | + for (i = 0; i < bitrates.length; i++) { | ||
| 114 | + $("#sl_bitrate").append("<option value='" + bitrates[i] + "'>" + bitrates[i] + " kbps</option"); | ||
| 115 | + } | ||
| 116 | + $("#sl_bitrate option[value='350']").attr("selected", true); | ||
| 117 | + }; | ||
| 118 | + srs_publisher.on_publisher_error = function(code, desc) { | ||
| 119 | + error(code, desc); | ||
| 120 | + }; | ||
| 121 | + srs_publisher.on_publisher_warn = function(code, desc) { | ||
| 122 | + warn(code, desc); | ||
| 123 | + }; | ||
| 124 | + srs_publisher.start(); | ||
| 125 | + | ||
| 126 | + // if no play specified, donot show the player, for debug the publisher. | ||
| 127 | + var query = parse_query_string(); | ||
| 128 | + if (query.no_play != "true") { | ||
| 129 | + // start the normal player with HLS supported. | ||
| 130 | + remote_player = new SrsPlayer("remote_player", 430, 185); | ||
| 131 | + remote_player.on_player_ready = function() { | ||
| 132 | + remote_player.set_bt(0.8); | ||
| 133 | + remote_player.set_fs("screen", 100); | ||
| 134 | + }; | ||
| 135 | + remote_player.start(); | ||
| 136 | + | ||
| 137 | + // start the realtime player. | ||
| 138 | + realtime_player = new SrsPlayer("realtime_player", 430, 185); | ||
| 139 | + realtime_player.on_player_ready = function() { | ||
| 140 | + realtime_player.set_bt(0.8); | ||
| 141 | + realtime_player.set_fs("screen", 100); | ||
| 142 | + }; | ||
| 143 | + realtime_player.start(); | ||
| 144 | + } | ||
| 145 | + }); | ||
| 146 | + | ||
| 147 | + /** | ||
| 148 | + * we generate the transcoded stream url for flash publish donot support HLS | ||
| 149 | + * which requires aac, so the publish vhost maybe players for example, we | ||
| 150 | + * use players_pub vhost(transcoded stream to which) for all clients, | ||
| 151 | + * both players and players_pub are write HLS to the sample dir, | ||
| 152 | + * it's ok for the players vhost disabled the HLS, only the | ||
| 153 | + * players_pub enalbed HLS. | ||
| 154 | + */ | ||
| 155 | + function update_play_url() { | ||
| 156 | + var url = $("#txt_url").val(); | ||
| 157 | + var ret = srs_parse_rtmp_url(url); | ||
| 158 | + var query = parse_query_string(); | ||
| 159 | + | ||
| 160 | + var srs_player_url = "http://" + query.host + query.dir + "/srs_player.html?"; | ||
| 161 | + srs_player_url += "vhost=" + srs_get_player_publish_vhost(ret.vhost) + "&port=" + ret.port + "&app=" + ret.app + "&stream=" + ret.stream; | ||
| 162 | + srs_player_url += "&autostart=true"; | ||
| 163 | + | ||
| 164 | + var srs_player_rt_url = "http://" + query.host + query.dir + "/srs_player.html?"; | ||
| 165 | + srs_player_rt_url += "vhost=" + ret.vhost + "&port=" + ret.port + "&app=" + ret.app + "&stream=" + ret.stream; | ||
| 166 | + srs_player_rt_url += "&autostart=true"; | ||
| 167 | + | ||
| 168 | + var jwplayer_url = "http://" + query.host + query.dir + "/jwplayer6.html?"; | ||
| 169 | + jwplayer_url += "vhost=" + srs_get_player_publish_vhost(ret.vhost) + "&port=" + ret.port + "&app=" + ret.app + "&stream=" + ret.stream; | ||
| 170 | + jwplayer_url += "&hls_autostart=true"; | ||
| 171 | + | ||
| 172 | + var hls_url = "http://" + ret.server + ":" + query.http_port + "/" + ret.app + "/" + ret.stream + ".m3u8"; | ||
| 173 | + | ||
| 174 | + $("#txt_play_realtime").text("RTMP低延时(点击打开)").attr("href", srs_player_rt_url).attr("target", "_blank"); | ||
| 175 | + $("#txt_play_url").text("RTMP已转码(点击打开)").attr("href", srs_player_url).attr("target", "_blank"); | ||
| 176 | + $("#txt_play_hls").text("HLS-m3u8(点击打开或右键复制)").attr("href", hls_url).attr("target", "_blank"); | ||
| 177 | + $("#txt_play_jwplayer").text("HLS-JWPlayer(点击打开)").attr("href", jwplayer_url).attr("target", "_blank"); | ||
| 178 | + } | ||
| 179 | + function on_user_publish() { | ||
| 180 | + if ($("#btn_publish").text() == "停止发布") { | ||
| 181 | + srs_publisher.stop(); | ||
| 182 | + $("#btn_publish").text("发布视频"); | ||
| 183 | + $("#txt_play_realtime").text("RTMP低延时(请发布视频)").attr("href", "#").attr("target", "_self"); | ||
| 184 | + $("#txt_play_url").text("RTMP已转码(请发布视频)").attr("href", "#").attr("target", "_self"); | ||
| 185 | + $("#txt_play_hls").text("HLS-m3u8(请发布视频)").attr("href", "#").attr("target", "_self"); | ||
| 186 | + $("#txt_play_jwplayer").text("HLS-JWPlayer(请发布视频)").attr("href", "#").attr("target", "_self"); | ||
| 187 | + return; | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + $("#btn_publish").text("停止发布"); | ||
| 191 | + | ||
| 192 | + update_play_url(); | ||
| 193 | + | ||
| 194 | + var url = $("#txt_url").val(); | ||
| 195 | + var vcodec = {}; | ||
| 196 | + var acodec = {}; | ||
| 197 | + | ||
| 198 | + acodec.device_code = $("#sl_microphones").val(); | ||
| 199 | + acodec.device_name = $("#sl_microphones").text(); | ||
| 200 | + | ||
| 201 | + vcodec.device_code = $("#sl_cameras").find("option:selected").val(); | ||
| 202 | + vcodec.device_name = $("#sl_cameras").find("option:selected").text(); | ||
| 203 | + | ||
| 204 | + vcodec.codec = $("#sl_vcodec").find("option:selected").val(); | ||
| 205 | + vcodec.profile = $("#sl_profile").find("option:selected").val(); | ||
| 206 | + vcodec.level = $("#sl_level").find("option:selected").val(); | ||
| 207 | + vcodec.fps = $("#sl_fps").find("option:selected").val(); | ||
| 208 | + vcodec.gop = $("#sl_gop").find("option:selected").val(); | ||
| 209 | + vcodec.size = $("#sl_size").find("option:selected").val(); | ||
| 210 | + vcodec.bitrate = $("#sl_bitrate").find("option:selected").val(); | ||
| 211 | + | ||
| 212 | + info("开始推流到服务器"); | ||
| 213 | + srs_publisher.publish(url, vcodec, acodec); | ||
| 214 | + | ||
| 215 | + if (realtime_player) { | ||
| 216 | + // directly play the url for the realtime player. | ||
| 217 | + realtime_player.stop(); | ||
| 218 | + realtime_player.play(url); | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + if (remote_player) { | ||
| 222 | + // the normal player should play the transcoded stream in another vhost. | ||
| 223 | + // for example, publish stream to vhost players, | ||
| 224 | + // the realtime player play the vhost players, which may donot support HLS, | ||
| 225 | + // the normal player play the vhost players_pub, which transcoded to h264/aac with HLS. | ||
| 226 | + var ret = srs_parse_rtmp_url(url); | ||
| 227 | + var pub_url = "rtmp://" + ret.server + ":" + ret.port + "/" + ret.app; | ||
| 228 | + pub_url += "?vhost=" + srs_get_player_publish_vhost(ret.vhost) + "/" + ret.stream; | ||
| 229 | + remote_player.stop(); | ||
| 230 | + remote_player.play(pub_url); | ||
| 231 | + } | ||
| 232 | + } | ||
| 233 | + | ||
| 234 | + function info(desc) { | ||
| 235 | + $("#txt_log").addClass("alert-info").removeClass("alert-error").removeClass("alert-warn"); | ||
| 236 | + $("#txt_log_title").text("Info:"); | ||
| 237 | + $("#txt_log_msg").text(desc); | ||
| 238 | + } | ||
| 239 | + function warn(code, desc) { | ||
| 240 | + $("#txt_log").removeClass("alert-info").removeClass("alert-error").addClass("alert-warn"); | ||
| 241 | + $("#txt_log_title").text("Warn:"); | ||
| 242 | + $("#txt_log_msg").text("code: " + code + ", " + desc); | ||
| 243 | + } | ||
| 244 | + function error(code, desc) { | ||
| 245 | + $("#txt_log").removeClass("alert-info").addClass("alert-error").removeClass("alert-warn"); | ||
| 246 | + $("#txt_log_title").text("Error:"); | ||
| 247 | + $("#txt_log_msg").text("code: " + code + ", " + desc); | ||
| 248 | + } | ||
| 249 | + </script> | ||
| 250 | +</head> | ||
| 251 | +<body> | ||
| 252 | +<div class="navbar navbar-fixed-top"> | ||
| 253 | + <div class="navbar-inner"> | ||
| 254 | + <div class="container"> | ||
| 255 | + <a class="brand" href="index.html">SRS</a> | ||
| 256 | + <div class="nav-collapse collapse"> | ||
| 257 | + <ul class="nav"> | ||
| 258 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 259 | + <li class="active"><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 260 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 261 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 262 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 263 | + <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 264 | + </ul> | ||
| 265 | + </div> | ||
| 266 | + </div> | ||
| 267 | + </div> | ||
| 268 | +</div> | ||
| 269 | +<div class="container"> | ||
| 270 | + <div class="alert alert-info fade in" id="txt_log"> | ||
| 271 | + <button type="button" class="close" data-dismiss="alert">×</button> | ||
| 272 | + <strong><span id="txt_log_title">Usage:</span></strong> | ||
| 273 | + <span id="txt_log_msg">设置编码参数,点“发布视频”,允许Flash访问摄像头即可推流</span> | ||
| 274 | + </div> | ||
| 275 | + <div class="control-group"> | ||
| 276 | + <div class="form-inline"> | ||
| 277 | + <button class="btn" id="btn_video_settings">视频编码配置</button> | ||
| 278 | + <button class="btn" id="btn_audio_settings">音频编码配置</button> | ||
| 279 | + </div> | ||
| 280 | + </div> | ||
| 281 | + <div class="control-group"> | ||
| 282 | + <div class="form-inline"> | ||
| 283 | + 发布地址: | ||
| 284 | + <input type="text" id="txt_url" class="input-xxlarge" value=""></input> | ||
| 285 | + <button class="btn btn-primary" id="btn_publish">发布视频</button> | ||
| 286 | + </div> | ||
| 287 | + </div> | ||
| 288 | + <div class="control-group"> | ||
| 289 | + <div class="form-inline"> | ||
| 290 | + 播放地址 | ||
| 291 | + 1.<a id="txt_play_realtime" class="input-xxlarge" href="#">RTMP低延时(请发布视频)</a> | ||
| 292 | + 2.<a id="txt_play_url" class="input-xxlarge" href="#">RTMP已转码(请发布视频)</a> | ||
| 293 | + 3.<a id="txt_play_hls" class="input-xxlarge" href="#">HLS-m3u8(请发布视频)</a> | ||
| 294 | + 4.<a id="txt_play_jwplayer" class="input-xxlarge" href="#">HLS-JWPlayer(请发布视频)</a> | ||
| 295 | + </div> | ||
| 296 | + </div> | ||
| 297 | + <div id="video_modal" class="modal hide fade"> | ||
| 298 | + <div class="modal-header"> | ||
| 299 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 300 | + <h3>视频编码</h3> | ||
| 301 | + </div> | ||
| 302 | + <div class="modal-body"> | ||
| 303 | + <div class="form-horizontal"> | ||
| 304 | + <div class="control-group"> | ||
| 305 | + <label class="control-label" for="sl_cameras"> | ||
| 306 | + 摄像头 | ||
| 307 | + <a id="sl_cameras_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 308 | + <img src="img/tooltip.png"/> | ||
| 309 | + </a> | ||
| 310 | + </label> | ||
| 311 | + <div class="controls"> | ||
| 312 | + <select class="span4" id="sl_cameras"></select> | ||
| 313 | + </div> | ||
| 314 | + </div> | ||
| 315 | + <div class="control-group"> | ||
| 316 | + <label class="control-label" for="sl_vcodec"> | ||
| 317 | + Codec | ||
| 318 | + <a id="sl_cameras_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 319 | + <img src="img/tooltip.png"/> | ||
| 320 | + </a> | ||
| 321 | + </label> | ||
| 322 | + <div class="controls"> | ||
| 323 | + <select class="span2" id="sl_vcodec"></select> | ||
| 324 | + </div> | ||
| 325 | + </div> | ||
| 326 | + <div class="control-group"> | ||
| 327 | + <label class="control-label" for="sl_profile"> | ||
| 328 | + Profile | ||
| 329 | + <a id="sl_profile_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 330 | + <img src="img/tooltip.png"/> | ||
| 331 | + </a> | ||
| 332 | + </label> | ||
| 333 | + <div class="controls"> | ||
| 334 | + <select class="span2" id="sl_profile"></select> | ||
| 335 | + </div> | ||
| 336 | + </div> | ||
| 337 | + <div class="control-group"> | ||
| 338 | + <label class="control-label" for="sl_level"> | ||
| 339 | + Level | ||
| 340 | + <a id="sl_level_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 341 | + <img src="img/tooltip.png"/> | ||
| 342 | + </a> | ||
| 343 | + </label> | ||
| 344 | + <div class="controls"> | ||
| 345 | + <select class="span2" id="sl_level"></select> | ||
| 346 | + </div> | ||
| 347 | + </div> | ||
| 348 | + <div class="control-group"> | ||
| 349 | + <label class="control-label" for="sl_gop"> | ||
| 350 | + GOP | ||
| 351 | + <a id="sl_gop_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 352 | + <img src="img/tooltip.png"/> | ||
| 353 | + </a> | ||
| 354 | + </label> | ||
| 355 | + <div class="controls"> | ||
| 356 | + <select class="span2" id="sl_gop"></select> | ||
| 357 | + </div> | ||
| 358 | + </div> | ||
| 359 | + <div class="control-group"> | ||
| 360 | + <label class="control-label" for="sl_size"> | ||
| 361 | + 尺寸 | ||
| 362 | + <a id="sl_size_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 363 | + <img src="img/tooltip.png"/> | ||
| 364 | + </a> | ||
| 365 | + </label> | ||
| 366 | + <div class="controls"> | ||
| 367 | + <select class="span2" id="sl_size"></select> | ||
| 368 | + </div> | ||
| 369 | + </div> | ||
| 370 | + <div class="control-group"> | ||
| 371 | + <label class="control-label" for="sl_fps"> | ||
| 372 | + 帧率 | ||
| 373 | + <a id="sl_fps_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 374 | + <img src="img/tooltip.png"/> | ||
| 375 | + </a> | ||
| 376 | + </label> | ||
| 377 | + <div class="controls"> | ||
| 378 | + <select class="span2" id="sl_fps"></select> | ||
| 379 | + </div> | ||
| 380 | + </div> | ||
| 381 | + <div class="control-group"> | ||
| 382 | + <label class="control-label" for="sl_bitrate"> | ||
| 383 | + 码率 | ||
| 384 | + <a id="sl_bitrate_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 385 | + <img src="img/tooltip.png"/> | ||
| 386 | + </a> | ||
| 387 | + </label> | ||
| 388 | + <div class="controls"> | ||
| 389 | + <select class="span2" id="sl_bitrate"></select> | ||
| 390 | + </div> | ||
| 391 | + </div> | ||
| 392 | + </div> | ||
| 393 | + </div> | ||
| 394 | + <div class="modal-footer"> | ||
| 395 | + <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">设置</button> | ||
| 396 | + </div> | ||
| 397 | + </div> | ||
| 398 | + <div id="audio_modal" class="modal hide fade"> | ||
| 399 | + <div class="modal-header"> | ||
| 400 | + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> | ||
| 401 | + <h3>音频编码</h3> | ||
| 402 | + </div> | ||
| 403 | + <div class="modal-body"> | ||
| 404 | + <div class="form-horizontal"> | ||
| 405 | + <div class="control-group"> | ||
| 406 | + <label class="control-label" for="sl_microphones"> | ||
| 407 | + 麦克风 | ||
| 408 | + <a id="worker_id_tips" href="#" data-toggle="tooltip" data-placement="right" title=""> | ||
| 409 | + <img src="img/tooltip.png"/> | ||
| 410 | + </a> | ||
| 411 | + </label> | ||
| 412 | + <div class="controls"> | ||
| 413 | + <select class="span4" id="sl_microphones"></select> | ||
| 414 | + </div> | ||
| 415 | + </div> | ||
| 416 | + </div> | ||
| 417 | + </div> | ||
| 418 | + <div class="modal-footer"> | ||
| 419 | + <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">设置</button> | ||
| 420 | + </div> | ||
| 421 | + </div> | ||
| 422 | + <div class="container"> | ||
| 423 | + <div class="row-fluid"> | ||
| 424 | + <div class="span6"> | ||
| 425 | + <div class="accordion-group"> | ||
| 426 | + <div class="accordion-heading"> | ||
| 427 | + <span class="accordion-toggle" data-toggle="collapse" href="#collapse1"> | ||
| 428 | + <strong>本地摄像头</strong> | ||
| 429 | + </span> | ||
| 430 | + </div> | ||
| 431 | + <div id="collapse1" class="accordion-body collapse in"> | ||
| 432 | + <div class="accordion-inner"> | ||
| 433 | + <div id="local_publisher"></div> | ||
| 434 | + </div> | ||
| 435 | + </div> | ||
| 436 | + </div> | ||
| 437 | + </div> | ||
| 438 | + <div class="span6"> | ||
| 439 | + <div class="accordion-group"> | ||
| 440 | + <div class="accordion-heading"> | ||
| 441 | + <span class="accordion-toggle" data-toggle="collapse" href="#collapse2"> | ||
| 442 | + <strong>远程服务器</strong> | ||
| 443 | + <a id="remote_tips" href="#" data-toggle="tooltip" data-placement="top" title=""> | ||
| 444 | + 黑屏<img src="img/tooltip.png"/> | ||
| 445 | + </a> | ||
| 446 | + </span> | ||
| 447 | + </div> | ||
| 448 | + <div id="collapse2" class="accordion-body collapse in"> | ||
| 449 | + <div class="accordion-inner"> | ||
| 450 | + <div id="remote_player"></div> | ||
| 451 | + </div> | ||
| 452 | + </div> | ||
| 453 | + </div> | ||
| 454 | + </div> | ||
| 455 | + </div> | ||
| 456 | + </div> | ||
| 457 | + <div class="container"> | ||
| 458 | + <div class="row-fluid"> | ||
| 459 | + <div class="span6"> | ||
| 460 | + <div class="accordion-group"> | ||
| 461 | + <div class="accordion-heading"> | ||
| 462 | + <span class="accordion-toggle" data-toggle="collapse" href="#collapse3"> | ||
| 463 | + <strong>远程服务器</strong> | ||
| 464 | + <a id="low_latecy_tips" href="#" data-toggle="tooltip" data-placement="top" title=""> | ||
| 465 | + 低延时<img src="img/tooltip.png"/> | ||
| 466 | + </a> | ||
| 467 | + </span> | ||
| 468 | + </div> | ||
| 469 | + <div id="collapse3" class="accordion-body collapse in"> | ||
| 470 | + <div class="accordion-inner"> | ||
| 471 | + <div id="realtime_player"></div> | ||
| 472 | + </div> | ||
| 473 | + </div> | ||
| 474 | + </div> | ||
| 475 | + </div> | ||
| 476 | + <div class="span6"> | ||
| 477 | + </div> | ||
| 478 | + </div> | ||
| 479 | + </div> | ||
| 480 | + <footer> | ||
| 481 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 482 | + </footer> | ||
| 483 | +</div> | ||
| 484 | +</body> | ||
| 485 | + |
| 1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
| 2 | +<actionScriptProperties analytics="false" mainApplicationPath="srs_publisher.as" projectUUID="f002791f-ee2e-41b7-aa3a-a7af6c65aa58" version="10"> | ||
| 3 | + <compiler additionalCompilerArguments="-locale en_US" autoRSLOrdering="true" copyDependentFiles="false" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="release" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true"> | ||
| 4 | + <compilerSourcePath/> | ||
| 5 | + <libraryPath defaultLinkType="0"> | ||
| 6 | + <libraryPathEntry kind="4" path=""> | ||
| 7 | + <excludedEntries> | ||
| 8 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/> | ||
| 9 | + <libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/> | ||
| 10 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc" useDefaultLinkType="false"/> | ||
| 11 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/> | ||
| 12 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/> | ||
| 13 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/> | ||
| 14 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/> | ||
| 15 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/mx/mx.swc" useDefaultLinkType="false"/> | ||
| 16 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/> | ||
| 17 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/> | ||
| 18 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/> | ||
| 19 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/> | ||
| 20 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/> | ||
| 21 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/> | ||
| 22 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/> | ||
| 23 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/> | ||
| 24 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/> | ||
| 25 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/> | ||
| 26 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/> | ||
| 27 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/> | ||
| 28 | + <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/> | ||
| 29 | + </excludedEntries> | ||
| 30 | + </libraryPathEntry> | ||
| 31 | + </libraryPath> | ||
| 32 | + <sourceAttachmentPath/> | ||
| 33 | + </compiler> | ||
| 34 | + <applications> | ||
| 35 | + <application path="srs_publisher.as"/> | ||
| 36 | + </applications> | ||
| 37 | + <modules/> | ||
| 38 | + <buildCSSFiles/> | ||
| 39 | + <flashCatalyst validateFlashCatalystCompatibility="false"/> | ||
| 40 | +</actionScriptProperties> |
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | +<projectDescription> | ||
| 3 | + <name>srs_publisher</name> | ||
| 4 | + <comment></comment> | ||
| 5 | + <projects> | ||
| 6 | + </projects> | ||
| 7 | + <buildSpec> | ||
| 8 | + <buildCommand> | ||
| 9 | + <name>com.adobe.flexbuilder.project.flexbuilder</name> | ||
| 10 | + <arguments> | ||
| 11 | + </arguments> | ||
| 12 | + </buildCommand> | ||
| 13 | + </buildSpec> | ||
| 14 | + <natures> | ||
| 15 | + <nature>com.adobe.flexbuilder.project.actionscriptnature</nature> | ||
| 16 | + </natures> | ||
| 17 | +</projectDescription> |
不能预览此文件类型
| 1 | +package | ||
| 2 | +{ | ||
| 3 | + import flash.display.Sprite; | ||
| 4 | + import flash.display.StageAlign; | ||
| 5 | + import flash.display.StageScaleMode; | ||
| 6 | + import flash.events.Event; | ||
| 7 | + import flash.events.NetStatusEvent; | ||
| 8 | + import flash.external.ExternalInterface; | ||
| 9 | + import flash.media.Camera; | ||
| 10 | + import flash.media.H264Profile; | ||
| 11 | + import flash.media.H264VideoStreamSettings; | ||
| 12 | + import flash.media.Microphone; | ||
| 13 | + import flash.media.Video; | ||
| 14 | + import flash.net.NetConnection; | ||
| 15 | + import flash.net.NetStream; | ||
| 16 | + import flash.ui.ContextMenu; | ||
| 17 | + import flash.ui.ContextMenuItem; | ||
| 18 | + import flash.utils.setTimeout; | ||
| 19 | + | ||
| 20 | + public class srs_publisher extends Sprite | ||
| 21 | + { | ||
| 22 | + // user set id. | ||
| 23 | + private var js_id:String = null; | ||
| 24 | + // user set callback | ||
| 25 | + private var js_on_publisher_ready:String = null; | ||
| 26 | + private var js_on_publisher_error:String = null; | ||
| 27 | + private var js_on_publisher_warn:String = null; | ||
| 28 | + | ||
| 29 | + // publish param url. | ||
| 30 | + private var user_url:String = null; | ||
| 31 | + // play param, user set width and height | ||
| 32 | + private var user_w:int = 0; | ||
| 33 | + private var user_h:int = 0; | ||
| 34 | + private var user_vcodec:Object = {}; | ||
| 35 | + private var user_acodec:Object = {}; | ||
| 36 | + | ||
| 37 | + // media specified. | ||
| 38 | + private var media_conn:NetConnection = null; | ||
| 39 | + private var media_stream:NetStream = null; | ||
| 40 | + private var media_video:Video = null; | ||
| 41 | + private var media_camera:Camera = null; | ||
| 42 | + private var media_microphone:Microphone = null; | ||
| 43 | + | ||
| 44 | + // error code. | ||
| 45 | + private const error_camera_get:int = 100; | ||
| 46 | + private const error_microphone_get:int = 101; | ||
| 47 | + private const error_camera_muted:int = 102; | ||
| 48 | + | ||
| 49 | + public function srs_publisher() | ||
| 50 | + { | ||
| 51 | + if (!this.stage) { | ||
| 52 | + this.addEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); | ||
| 53 | + } else { | ||
| 54 | + this.system_on_add_to_stage(null); | ||
| 55 | + } | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * system event callback, when this control added to stage. | ||
| 60 | + * the main function. | ||
| 61 | + */ | ||
| 62 | + private function system_on_add_to_stage(evt:Event):void { | ||
| 63 | + this.removeEventListener(Event.ADDED_TO_STAGE, this.system_on_add_to_stage); | ||
| 64 | + | ||
| 65 | + this.stage.align = StageAlign.TOP_LEFT; | ||
| 66 | + this.stage.scaleMode = StageScaleMode.NO_SCALE; | ||
| 67 | + | ||
| 68 | + this.contextMenu = new ContextMenu(); | ||
| 69 | + this.contextMenu.hideBuiltInItems(); | ||
| 70 | + | ||
| 71 | + var flashvars:Object = this.root.loaderInfo.parameters; | ||
| 72 | + | ||
| 73 | + if (!flashvars.hasOwnProperty("id")) { | ||
| 74 | + throw new Error("must specifies the id"); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + this.js_id = flashvars.id; | ||
| 78 | + this.js_on_publisher_ready = flashvars.on_publisher_ready; | ||
| 79 | + this.js_on_publisher_error = flashvars.on_publisher_error; | ||
| 80 | + this.js_on_publisher_warn = flashvars.on_publisher_warn; | ||
| 81 | + | ||
| 82 | + flash.utils.setTimeout(this.system_on_js_ready, 0); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + /** | ||
| 86 | + * system callack event, when js ready, register callback for js. | ||
| 87 | + * the actual main function. | ||
| 88 | + */ | ||
| 89 | + private function system_on_js_ready():void { | ||
| 90 | + if (!flash.external.ExternalInterface.available) { | ||
| 91 | + trace("js not ready, try later."); | ||
| 92 | + flash.utils.setTimeout(this.system_on_js_ready, 100); | ||
| 93 | + return; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + flash.external.ExternalInterface.addCallback("__publish", this.js_call_publish); | ||
| 97 | + flash.external.ExternalInterface.addCallback("__stop", this.js_call_stop); | ||
| 98 | + | ||
| 99 | + var cameras:Array = Camera.names; | ||
| 100 | + var microphones:Array = Microphone.names; | ||
| 101 | + trace("retrieve system cameras(" + cameras + ") and microphones(" + microphones + ")"); | ||
| 102 | + | ||
| 103 | + flash.external.ExternalInterface.call(this.js_on_publisher_ready, this.js_id, cameras, microphones); | ||
| 104 | + } | ||
| 105 | + | ||
| 106 | + /** | ||
| 107 | + * notify the js an error occur. | ||
| 108 | + */ | ||
| 109 | + private function system_error(code:int, desc:String):void { | ||
| 110 | + trace("system error, code=" + code + ", error=" + desc); | ||
| 111 | + flash.external.ExternalInterface.call(this.js_on_publisher_error, this.js_id, code); | ||
| 112 | + } | ||
| 113 | + private function system_warn(code:int, desc:String):void { | ||
| 114 | + trace("system warn, code=" + code + ", error=" + desc); | ||
| 115 | + flash.external.ExternalInterface.call(this.js_on_publisher_warn, this.js_id, code); | ||
| 116 | + } | ||
| 117 | + | ||
| 118 | + /** | ||
| 119 | + * publish stream to server. | ||
| 120 | + * @param url a string indicates the rtmp url to publish. | ||
| 121 | + * @param _width, the player width. | ||
| 122 | + * @param _height, the player height. | ||
| 123 | + * @param vcodec an object contains the video codec info. | ||
| 124 | + * @param acodec an object contains the audio codec info. | ||
| 125 | + */ | ||
| 126 | + private function js_call_publish(url:String, _width:int, _height:int, vcodec:Object, acodec:Object):void { | ||
| 127 | + trace("start to publish to " + url + ", vcodec " + JSON.stringify(vcodec) + ", acodec " + JSON.stringify(acodec)); | ||
| 128 | + | ||
| 129 | + this.user_url = url; | ||
| 130 | + this.user_w = _width; | ||
| 131 | + this.user_h = _height; | ||
| 132 | + this.user_vcodec = vcodec; | ||
| 133 | + this.user_acodec = acodec; | ||
| 134 | + | ||
| 135 | + this.js_call_stop(); | ||
| 136 | + | ||
| 137 | + // microphone and camera | ||
| 138 | + var m:Microphone = Microphone.getMicrophone(acodec.device_code); | ||
| 139 | + if(m == null){ | ||
| 140 | + this.system_error(this.error_microphone_get, "failed to open microphone " + acodec.device_code + "(" + acodec.device_name + ")"); | ||
| 141 | + return; | ||
| 142 | + } | ||
| 143 | + // ignore muted, for flash will require user to access it. | ||
| 144 | + | ||
| 145 | + // Remark: the name is the index! | ||
| 146 | + var c:Camera = Camera.getCamera(vcodec.device_code); | ||
| 147 | + if(c == null){ | ||
| 148 | + this.system_error(this.error_camera_get, "failed to open camera " + vcodec.device_code + "(" + vcodec.device_name + ")"); | ||
| 149 | + return; | ||
| 150 | + } | ||
| 151 | + // ignore muted, for flash will require user to access it. | ||
| 152 | + // but we still warn user. | ||
| 153 | + if(c && c.muted){ | ||
| 154 | + this.system_warn(this.error_camera_muted, "Access Denied, camera " + vcodec.device_code + "(" + vcodec.device_name + ") is muted"); | ||
| 155 | + } | ||
| 156 | + | ||
| 157 | + this.media_camera = c; | ||
| 158 | + this.media_microphone = m; | ||
| 159 | + | ||
| 160 | + this.media_conn = new NetConnection(); | ||
| 161 | + this.media_conn.client = {}; | ||
| 162 | + this.media_conn.client.onBWDone = function():void {}; | ||
| 163 | + this.media_conn.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void { | ||
| 164 | + trace ("NetConnection: code=" + evt.info.code); | ||
| 165 | + | ||
| 166 | + if (evt.info.hasOwnProperty("data") && evt.info.data) { | ||
| 167 | + // for context menu | ||
| 168 | + var customItems:Array = [new ContextMenuItem("SrsPlayer")]; | ||
| 169 | + if (evt.info.data.hasOwnProperty("srs_server")) { | ||
| 170 | + customItems.push(new ContextMenuItem("Server: " + evt.info.data.srs_server)); | ||
| 171 | + } | ||
| 172 | + if (evt.info.data.hasOwnProperty("srs_contributor")) { | ||
| 173 | + customItems.push(new ContextMenuItem("Contributor: " + evt.info.data.srs_contributor)); | ||
| 174 | + } | ||
| 175 | + contextMenu.customItems = customItems; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + // TODO: FIXME: failed event. | ||
| 179 | + if (evt.info.code != "NetConnection.Connect.Success") { | ||
| 180 | + return; | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + media_stream = new NetStream(media_conn); | ||
| 184 | + media_stream.client = {}; | ||
| 185 | + media_stream.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void { | ||
| 186 | + trace ("NetStream: code=" + evt.info.code); | ||
| 187 | + | ||
| 188 | + // TODO: FIXME: failed event. | ||
| 189 | + }); | ||
| 190 | + | ||
| 191 | + __build_video_codec(media_stream, c, vcodec); | ||
| 192 | + __build_audio_codec(media_stream, m, acodec); | ||
| 193 | + | ||
| 194 | + if (media_microphone) { | ||
| 195 | + media_stream.attachAudio(m); | ||
| 196 | + } | ||
| 197 | + if (media_camera) { | ||
| 198 | + media_stream.attachCamera(c); | ||
| 199 | + } | ||
| 200 | + | ||
| 201 | + var streamName:String = url.substr(url.lastIndexOf("/")); | ||
| 202 | + media_stream.publish(streamName); | ||
| 203 | + | ||
| 204 | + media_video = new Video(); | ||
| 205 | + media_video.width = _width; | ||
| 206 | + media_video.height = _height; | ||
| 207 | + media_video.attachCamera(media_camera); | ||
| 208 | + media_video.smoothing = true; | ||
| 209 | + addChild(media_video); | ||
| 210 | + | ||
| 211 | + //__draw_black_background(_width, _height); | ||
| 212 | + | ||
| 213 | + // lowest layer, for mask to cover it. | ||
| 214 | + setChildIndex(media_video, 0); | ||
| 215 | + }); | ||
| 216 | + | ||
| 217 | + var tcUrl:String = this.user_url.substr(0, this.user_url.lastIndexOf("/")); | ||
| 218 | + this.media_conn.connect(tcUrl); | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + /** | ||
| 222 | + * function for js to call: to stop the stream. ignore if not publish. | ||
| 223 | + */ | ||
| 224 | + private function js_call_stop():void { | ||
| 225 | + if (this.media_video) { | ||
| 226 | + this.removeChild(this.media_video); | ||
| 227 | + this.media_video = null; | ||
| 228 | + } | ||
| 229 | + if (this.media_stream) { | ||
| 230 | + this.media_stream.close(); | ||
| 231 | + this.media_stream = null; | ||
| 232 | + } | ||
| 233 | + if (this.media_conn) { | ||
| 234 | + this.media_conn.close(); | ||
| 235 | + this.media_conn = null; | ||
| 236 | + } | ||
| 237 | + } | ||
| 238 | + | ||
| 239 | + private function __build_audio_codec(stream:NetStream, m:Microphone, acodec:Object):void { | ||
| 240 | + if (!m) { | ||
| 241 | + return; | ||
| 242 | + } | ||
| 243 | + | ||
| 244 | + // if no microphone, donot set the params. | ||
| 245 | + if(m == null){ | ||
| 246 | + return; | ||
| 247 | + } | ||
| 248 | + | ||
| 249 | + // use default values. | ||
| 250 | + var microEncodeQuality:int = 8; | ||
| 251 | + var microRate:int = 22; // 22 === 22050 Hz | ||
| 252 | + | ||
| 253 | + trace("[Publish] audio encoding parameters: " | ||
| 254 | + + "audio(microphone) encodeQuality=" + microEncodeQuality | ||
| 255 | + + ", rate=" + microRate + "(22050Hz)" | ||
| 256 | + ); | ||
| 257 | + | ||
| 258 | + // The encoded speech quality when using the Speex codec. Possible values are from 0 to 10. The default value is 6. Higher numbers | ||
| 259 | + // represent higher quality but require more bandwidth, as shown in the following table. The bit rate values that are listed represent | ||
| 260 | + // net bit rates and do not include packetization overhead. | ||
| 261 | + m.encodeQuality = microEncodeQuality; | ||
| 262 | + | ||
| 263 | + // The rate at which the microphone is capturing sound, in kHz. Acceptable values are 5, 8, 11, 22, and 44. The default value is 8 kHz | ||
| 264 | + // if your sound capture device supports this value. Otherwise, the default value is the next available capture level above 8 kHz that | ||
| 265 | + // your sound capture device supports, usually 11 kHz. | ||
| 266 | + m.rate = microRate; | ||
| 267 | + } | ||
| 268 | + private function __build_video_codec(stream:NetStream, c:Camera, vcodec:Object):void { | ||
| 269 | + if (!c) { | ||
| 270 | + return; | ||
| 271 | + } | ||
| 272 | + | ||
| 273 | + if(vcodec.codec == "vp6"){ | ||
| 274 | + trace("use VP6, donot use H.264 publish encoding."); | ||
| 275 | + return; | ||
| 276 | + } | ||
| 277 | + | ||
| 278 | + var x264profile:String = (vcodec.profile == "main") ? H264Profile.MAIN : H264Profile.BASELINE; | ||
| 279 | + var x264level:String = vcodec.level; | ||
| 280 | + var cameraFps:Number = Number(vcodec.fps); | ||
| 281 | + var x264KeyFrameInterval:int = int(vcodec.gop * cameraFps); | ||
| 282 | + var cameraWidth:int = String(vcodec.size).split("x")[0]; | ||
| 283 | + var cameraHeight:int = String(vcodec.size).split("x")[1]; | ||
| 284 | + var cameraBitrate:int = int(vcodec.bitrate); | ||
| 285 | + | ||
| 286 | + // use default values. | ||
| 287 | + var cameraQuality:int = 85; | ||
| 288 | + | ||
| 289 | + trace("[Publish] video h.264(x264) encoding parameters: " | ||
| 290 | + + "profile=" + x264profile | ||
| 291 | + + ", level=" + x264level | ||
| 292 | + + ", keyFrameInterval(gop)=" + x264KeyFrameInterval | ||
| 293 | + + "; video(camera) width=" + cameraWidth | ||
| 294 | + + ", height=" + cameraHeight | ||
| 295 | + + ", fps=" + cameraFps | ||
| 296 | + + ", bitrate=" + cameraBitrate | ||
| 297 | + + ", quality=" + cameraQuality | ||
| 298 | + ); | ||
| 299 | + | ||
| 300 | + var h264Settings:H264VideoStreamSettings = new H264VideoStreamSettings(); | ||
| 301 | + // we MUST set its values first, then set the NetStream.videoStreamSettings, or it will keep the origin values. | ||
| 302 | + h264Settings.setProfileLevel(x264profile, x264level); | ||
| 303 | + stream.videoStreamSettings = h264Settings; | ||
| 304 | + // the setKeyFrameInterval/setMode/setQuality use the camera settings. | ||
| 305 | + // http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/VideoStreamSettings.html | ||
| 306 | + // Note This feature will be supported in future releases of Flash Player and AIR, for now, Camera parameters are used. | ||
| 307 | + // | ||
| 308 | + //h264Settings.setKeyFrameInterval(4); | ||
| 309 | + //h264Settings.setMode(800, 600, 15); | ||
| 310 | + //h264Settings.setQuality(500, 0); | ||
| 311 | + | ||
| 312 | + // set the camera and microphone. | ||
| 313 | + | ||
| 314 | + // setKeyFrameInterval(keyFrameInterval:int):void | ||
| 315 | + // keyFrameInterval:int — A value that specifies which video frames are transmitted in full (as keyframes) instead of being | ||
| 316 | + // interpolated by the video compression algorithm. A value of 1 means that every frame is a keyframe, a value of 3 means | ||
| 317 | + // that every third frame is a keyframe, and so on. Acceptable values are 1 through 48. | ||
| 318 | + c.setKeyFrameInterval(x264KeyFrameInterval); | ||
| 319 | + | ||
| 320 | + // setMode(width:int, height:int, fps:Number, favorArea:Boolean = true):void | ||
| 321 | + // width:int — The requested capture width, in pixels. The default value is 160. | ||
| 322 | + // height:int — The requested capture height, in pixels. The default value is 120. | ||
| 323 | + // fps:Number — The requested rate at which the camera should capture data, in frames per second. The default value is 15. | ||
| 324 | + c.setMode(cameraWidth, cameraHeight, cameraFps); | ||
| 325 | + | ||
| 326 | + // setQuality(bandwidth:int, quality:int):void | ||
| 327 | + // bandwidth:int — Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. | ||
| 328 | + // To specify that the video can use as much bandwidth as needed to maintain the value of quality, pass 0 for bandwidth. | ||
| 329 | + // The default value is 16384. | ||
| 330 | + // quality:int — An integer that specifies the required level of picture quality, as determined by the amount of compression | ||
| 331 | + // being applied to each video frame. Acceptable values range from 1 (lowest quality, maximum compression) to 100 | ||
| 332 | + // (highest quality, no compression). To specify that picture quality can vary as needed to avoid exceeding bandwidth, | ||
| 333 | + // pass 0 for quality. | ||
| 334 | + // winlin: | ||
| 335 | + // bandwidth is in bps not kbps. 500*1000 = 500kbps. | ||
| 336 | + // quality=1 is lowest quality, 100 is highest quality. | ||
| 337 | + c.setQuality(cameraBitrate * 1000, cameraQuality); | ||
| 338 | + } | ||
| 339 | + } | ||
| 340 | +} |
trunk/research/players/vlc.html
0 → 100755
| 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/swfobject.js"></script> | ||
| 10 | + <script type="text/javascript" src="js/srs.js"></script> | ||
| 11 | + <style> | ||
| 12 | + body{ | ||
| 13 | + padding-top: 55px; | ||
| 14 | + } | ||
| 15 | + </style> | ||
| 16 | + <script type="text/javascript"> | ||
| 17 | + $(function(){ | ||
| 18 | + update_nav(); | ||
| 19 | + $("#main_frame").attr("src", "http://www.videolan.org/vlc/"); | ||
| 20 | + }); | ||
| 21 | + </script> | ||
| 22 | +</head> | ||
| 23 | +<body> | ||
| 24 | +<div class="navbar navbar-fixed-top"> | ||
| 25 | + <div class="navbar-inner"> | ||
| 26 | + <div class="container"> | ||
| 27 | + <a class="brand" href="index.html">SRS</a> | ||
| 28 | + <div class="nav-collapse collapse"> | ||
| 29 | + <ul class="nav"> | ||
| 30 | + <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li> | ||
| 31 | + <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li> | ||
| 32 | + <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li> | ||
| 33 | + <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li> | ||
| 34 | + <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li> | ||
| 35 | + <li class="active"><a id="nav_vlc" href="vlc.html">VLC播放器</a></li> | ||
| 36 | + </ul> | ||
| 37 | + </div> | ||
| 38 | + </div> | ||
| 39 | + </div> | ||
| 40 | +</div> | ||
| 41 | +<div class="container"> | ||
| 42 | + <iframe id="main_frame" width="100%" height="800" frameBorder="0"></iframe> | ||
| 43 | +</div> | ||
| 44 | +<div class="container"> | ||
| 45 | + <hr> | ||
| 46 | + <footer> | ||
| 47 | + <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team © 2013</a></p> | ||
| 48 | + </footer> | ||
| 49 | +</div> | ||
| 50 | +</body> | ||
| 51 | + |
| @@ -139,6 +139,8 @@ int SrsRequest::discovery_app() | @@ -139,6 +139,8 @@ int SrsRequest::discovery_app() | ||
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | + strip(); | ||
| 143 | + | ||
| 142 | // resolve the vhost from config | 144 | // resolve the vhost from config |
| 143 | SrsConfDirective* parsed_vhost = config->get_vhost(vhost); | 145 | SrsConfDirective* parsed_vhost = config->get_vhost(vhost); |
| 144 | if (parsed_vhost) { | 146 | if (parsed_vhost) { |
| @@ -611,7 +613,7 @@ int SrsRtmp::response_connect_app(SrsRequest *req, const char *ip) | @@ -611,7 +613,7 @@ int SrsRtmp::response_connect_app(SrsRequest *req, const char *ip) | ||
| 611 | pkt->info->set("data", data); | 613 | pkt->info->set("data", data); |
| 612 | 614 | ||
| 613 | data->set("srs_version", new SrsAmf0String(RTMP_SIG_FMS_VER)); | 615 | data->set("srs_version", new SrsAmf0String(RTMP_SIG_FMS_VER)); |
| 614 | - data->set("srs_server", new SrsAmf0String(RTMP_SIG_SRS_NAME)); | 616 | + data->set("srs_server", new SrsAmf0String(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")")); |
| 615 | data->set("srs_license", new SrsAmf0String(RTMP_SIG_SRS_LICENSE)); | 617 | data->set("srs_license", new SrsAmf0String(RTMP_SIG_SRS_LICENSE)); |
| 616 | data->set("srs_role", new SrsAmf0String(RTMP_SIG_SRS_ROLE)); | 618 | data->set("srs_role", new SrsAmf0String(RTMP_SIG_SRS_ROLE)); |
| 617 | data->set("srs_url", new SrsAmf0String(RTMP_SIG_SRS_URL)); | 619 | data->set("srs_url", new SrsAmf0String(RTMP_SIG_SRS_URL)); |
| @@ -620,8 +622,11 @@ int SrsRtmp::response_connect_app(SrsRequest *req, const char *ip) | @@ -620,8 +622,11 @@ int SrsRtmp::response_connect_app(SrsRequest *req, const char *ip) | ||
| 620 | data->set("srs_email", new SrsAmf0String(RTMP_SIG_SRS_EMAIL)); | 622 | data->set("srs_email", new SrsAmf0String(RTMP_SIG_SRS_EMAIL)); |
| 621 | data->set("srs_copyright", new SrsAmf0String(RTMP_SIG_SRS_COPYRIGHT)); | 623 | data->set("srs_copyright", new SrsAmf0String(RTMP_SIG_SRS_COPYRIGHT)); |
| 622 | 624 | ||
| 623 | - if(ip) | 625 | + if (ip) { |
| 624 | data->set("srs_server_ip", new SrsAmf0String(ip)); | 626 | data->set("srs_server_ip", new SrsAmf0String(ip)); |
| 627 | + } | ||
| 628 | + | ||
| 629 | + data->set("srs_contributor", new SrsAmf0String(RTMP_SIG_SRS_CONTRIBUTOR)); | ||
| 625 | 630 | ||
| 626 | msg->set_packet(pkt, 0); | 631 | msg->set_packet(pkt, 0); |
| 627 | 632 | ||
| @@ -1297,11 +1302,13 @@ int SrsRtmp::bandwidth_check_play(int duration_ms, int interval_ms, int &actual_ | @@ -1297,11 +1302,13 @@ int SrsRtmp::bandwidth_check_play(int duration_ms, int interval_ms, int &actual_ | ||
| 1297 | SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket; | 1302 | SrsOnStatusCallPacket* pkt = new SrsOnStatusCallPacket; |
| 1298 | pkt->command_name = SRS_BW_CHECK_PLAYING; | 1303 | pkt->command_name = SRS_BW_CHECK_PLAYING; |
| 1299 | 1304 | ||
| 1300 | - for (int i = 0; i < 100; ++i) { | 1305 | + int object_num = 1; |
| 1306 | + for (int i = 0; i < object_num; ++i) { | ||
| 1301 | char buf[32]; | 1307 | char buf[32]; |
| 1302 | sprintf(buf, "%d", i); | 1308 | sprintf(buf, "%d", i); |
| 1303 | pkt->data->set(buf, new SrsAmf0String(random_data)); | 1309 | pkt->data->set(buf, new SrsAmf0String(random_data)); |
| 1304 | } | 1310 | } |
| 1311 | + object_num += 1; | ||
| 1305 | msg->set_packet(pkt, 0); | 1312 | msg->set_packet(pkt, 0); |
| 1306 | 1313 | ||
| 1307 | play_bytes += pkt->get_payload_length(); | 1314 | play_bytes += pkt->get_payload_length(); |
-
请 注册 或 登录 后发表评论