Blame view

trunk/research/players/srs_chat.html 30.2 KB
1 2 3 4 5 6 7 8 9
<!DOCTYPE html>
<html>
<head>
    <title>SRS</title>   
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
    <script type="text/javascript" src="js/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript" src="js/swfobject.js"></script>
10
    <script type="text/javascript" src="js/json2.js"></script>
winlin authored
11
    <script type="text/javascript" src="js/srs.page.js"></script>
12
    <script type="text/javascript" src="js/srs.log.js"></script>
winlin authored
13 14 15
    <script type="text/javascript" src="js/srs.player.js"></script>
    <script type="text/javascript" src="js/srs.publisher.js"></script>
    <script type="text/javascript" src="js/srs.utility.js"></script>
16 17 18 19
    <style>
        body{
            padding-top: 55px;
        }
20 21 22
        .accordion-group {
            width: 310px;
        }
23 24 25 26
    </style>
    <script type="text/javascript">
        var srs_publisher = null;
        var realtime_player = null;
winlin authored
27 28 29 30 31
        var api_server = null;
        var self_chat = null;
        var global_chat_user_id = 200;
        var previous_chats = [];
        var no_play = false;
32
        
33
        var query = parse_query_string();
34 35 36 37
        $(function(){
            // get the vhost and port to set the default url.
            // for example: http://192.168.1.213/players/jwplayer6.html?port=1935&vhost=demo
            // url set to: rtmp://demo:1935/live/livestream
winlin authored
38
            srs_init_publish("#txt_url");
39
            
40 41 42 43 44 45 46 47 48 49 50 51 52
            // support 5x3+1 users
            for (var i = 0; i < 5; i++) {
                var tr = $("<tr></tr>").hide();
                $("#lst_chats").append(tr);
                
                for (var j = 0; j < 3; j++) {
                    tr.append($("<td></td>").attr("id", "td_" + ((i+1) * 8 + j)));
                }
            }
            // remove border of row.
            $("#lst_chats").find("td").css("border", "none").css("padding", "2px")
                .css("padding-left", "0px").css("width", "327px");
            
53 54 55 56 57
            if (query.agent == "true") {
                document.write(navigator.userAgent);
                return;
            }
            
58 59 60 61
            $("#realtime_player_url").tooltip({
                title: "右键复制RTMP地址"
            });
            
winlin authored
62 63 64 65 66 67
            // if no play specified, donot show the player, for debug the publisher.
            if (query.no_play == "true") {
                no_play = true;
            }
            
            $("#btn_video_settings").click(function(){
68 69
                $("#video_modal").modal({show:true});
            });
winlin authored
70
            $("#btn_audio_settings").click(function(){
71 72
                $("#audio_modal").modal({show:true});
            });
winlin authored
73 74
            $("#btn_join").click(on_user_publish);
75 76 77 78
            // for publish, we use randome stream name.
            $("#txt_url").val($("#txt_url").val() + "." + new Date().getTime());
            
            // start the publisher.
79
            srs_publisher = new SrsPublisher("local_publisher", 280, 180);
80
            srs_publisher.on_publisher_ready = function(cameras, microphones) {
81
                srs_chat_initialize_page(
winlin authored
82 83 84 85 86
                    cameras, microphones,
                    "#sl_cameras", "#sl_microphones", 
                    "#sl_vcodec", "#sl_profile", "#sl_level", "#sl_gop", "#sl_size",
                    "#sl_fps", "#sl_bitrate"
                );
87 88
            };
            srs_publisher.on_publisher_error = function(code, desc) {
89 90 91 92
                if (!on_publish_stop()) {
                    return;
                }
                
93
                error(code, desc + "请重试。");
94 95 96 97 98 99
            };
            srs_publisher.on_publisher_warn = function(code, desc) {
                warn(code, desc);
            };
            srs_publisher.start();
            
100 101
            update_play_url();
            
winlin authored
102
            if (!no_play) {
103
                // start the realtime player.
104
                realtime_player = new SrsPlayer("realtime_player", 280, 180);
105
                realtime_player.on_player_ready = function() {
106
                    this.set_bt(0.5);
107
                };
winlin authored
108 109 110
                realtime_player.on_player_metadata = function(metadata) {
                    this.set_dar(0, 0);
                    this.set_fs("screen", 100);
111 112
                    
                    info("推流到服务器成功。请戴耳机聊天,否则音箱的声音会进入麦克风造成回声。");
winlin authored
113
                }
114 115
                realtime_player.start();
            }
winlin authored
116
            
117 118
            $("#txt_name").focus();
            
winlin authored
119 120
            api_server = "http://" + query.hostname + ":" + srs_get_api_server_port() + "/api/v1/chats";
            refresh();
121 122
        });
        
123 124 125 126 127 128 129 130 131 132 133 134
        function on_publish_stop() {
            if (!srs_can_republish()) {
                $("#btn_join").attr("disabled", true);
                error(0, "您使用的浏览器很弱,请关闭页面后重新打开页面(刷新也不管用)。<br/>推荐使用Chrome/Firefox/Safari/Opera浏览器,支持重试");
                
                srs_log_disabled = true;
                return false;
            }
            
            return true;
        }
        
135 136 137 138 139 140
        function update_play_url() {
            var url = $("#txt_url").val();
            
            $("#realtime_player_url").attr("href", url).attr("target", "_blank");
        }
        
winlin authored
141 142 143 144 145
        function refresh() {
            if (!self_chat) {
                setTimeout(refresh, 1000);
                return;
            }
146
            
winlin authored
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
            $.ajax({
                type       : "GET",
                async      : true,
                url        : api_server,
                contentType: "text/html",
                data       : "",
                dataType   : "json",
                complete   : function() {
                },
                error      : function(ret) {
                    setTimeout(refresh, 5000);
                    warn(101, "查询会议室失败:" + JSON.stringify(ret));
                },
                success    : function(ret) {
                    if(0 != ret["code"]) {
                        warn(102, "查询会议室失败: " + JSON.stringify(ret));
                        setTimeout(refresh, 5000);
                        return;
                    }

                    var chats = ret["data"]["chats"];
                    var server_time = ret["now"];
                    
                    on_get_chats(chats);
                    setTimeout(refresh, 5000);
                }
            });
174
        }
winlin authored
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195
        function on_get_chats(chats) {
            if (!self_chat) {
                return;
            }
            
            // get self, check self is valid?
            var _self_chat = null;
            for (var i = 0; i < chats.length; i++) {
                var chat = chats[i];
                if (self_chat && self_chat.id == chat.id) {
                    _self_chat = chat;
                    break;
                }
            }
            // rejoin if invalid.
            if (!_self_chat) {
                on_user_exit_chat(function(){
                    on_user_join_chat(function(){
                        info("重新加入会议室成功");
                    });
                });
196 197 198
                return;
            }
            
winlin authored
199
            render_chat_room(chats);
200
            
winlin authored
201 202 203
            if (!self_chat) {
                return;
            }
204
            
winlin authored
205 206
            // update self heartbeat.
            var url = api_server + "/" + self_chat.id;
207
            
winlin authored
208 209
            var chat = {};
            chat.localtime = new Date().getTime();
210
            
winlin authored
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231
            // publish to api server to requires an id.
            $.ajax({
                type       : "PUT",
                async      : true,
                url        : url,
                contentType: "text/html",
                data       : JSON.stringify(chat),
                dataType   : "json",
                complete   : function() {
                },
                error      : function(ret) {
                    warn(105, "更新会议室信息失败:" + JSON.stringify(ret));
                },
                success    : function(ret) {
                    if(0 != ret["code"]) {
                        warn(106, "更新会议室信息失败:: " + JSON.stringify(ret));
                        return;
                    }
                }
            });
        }
winlin authored
232
        function render_chat_room(original_chats) {
winlin authored
233 234 235
            if (!self_chat) {
                return;
            }
236
            
winlin authored
237 238 239 240
            var chats = [];
            for (var i = 0; i < original_chats.length; i++) {
                var chat = original_chats[i];
                
winlin authored
241 242 243 244 245
                // ignore the self.
                if (self_chat && self_chat.id == chat.id) {
                    continue;
                }
                
winlin authored
246 247 248 249 250 251 252
                chats.push(chat);
            }
            
            // new added chat
            for (var i = 0; i < chats.length; i++) {
                var chat = chats[i];
                
winlin authored
253 254 255
                // if previous exists, ignore, only add new here.
                var previous_chat = get_previous_chat_user(previous_chats, chat.id);
                if (previous_chat) {
256
                    // update reference.
winlin authored
257 258
                    chat.ui = previous_chat.ui;
                    chat.parent = previous_chat.parent;
winlin authored
259
                    chat.player = previous_chat.player;
winlin authored
260 261
                    if (chat.player) {
                        chat.player.private_object = chat;
winlin authored
262
                    }
winlin authored
263
                    continue;
winlin authored
264 265
                }
            }
266
            
winlin authored
267 268 269 270 271 272 273 274 275 276 277 278 279
            // removed chat
            for (var i = 0; i < previous_chats.length; i++) {
                var chat = previous_chats[i];
                
                var new_chat = get_previous_chat_user(chats, chat.id);
                if (new_chat) {
                    continue;
                }
                
                if (chat.player) {
                    chat.player.stop();
                }
                $("#div_" + chat.id).remove();
280 281
            }
            
winlin authored
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
            // hide empty rows.
            $("#lst_chats").find("tr").each(function(){
                var empty = true;
                
                $(this).find("td").each(function(){
                    if ($(this).html() != "") {
                        empty = false;
                        return false; // abort each
                    }
                    return true;
                });
                
                if (empty) {
                    $(this).hide();
                }
            });
            
            // render the chat
            for (var i = 0; i < chats.length; i++) {
                var chat = chats[i];
                
                // if redered, ignore.
                if (chat.parent) {
                    continue;
                }
                
                // generate the ui of chat
                if (!chat.ui) {
                    global_chat_user_id++;
                    
                    // username: a str indicates the user name.
                    // url: a str indicates the url of user stream.
                    // join_date: a str indicates the join timestamp in seconds.
                    // join_date_str: friendly formated time.
                    var obj = $("<div/>").html($("#template").html());
                    if (true) {
                        // save current ui object to the chat.
                        chat.ui = obj;
                        
                        $(obj).attr("chat_id", chat.id);
                        $(obj).attr("id", "div_" + chat.id); // for specifed chat: $("#div_" + chat_id)
                        $(obj).attr("class", "div_chat"); // for all chats: $(".div_chat")
                        $(obj).find("#chat_player").attr("id", "rp_" + chat.id); // for specifed player: $("#rp_" + chat_id)
                        $(obj).find("#chat_player_raw").attr("id", "rp_raw_" + chat.id); // for specifed player: $("#rp_raw_" + chat_id)
                        $(obj).find("#user_name").text(chat.username);
327
                        $(obj).find("#user_player_url").attr("href", chat.url);
328
                        $(obj).find("#join_date").text(chat.join_date_str.split(" ")[1]);
winlin authored
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358
                        $(obj).find("#collapseM").attr("id", "collapse_" + global_chat_user_id);
                        $(obj).find("#headerN").attr("href", "#collapse_" + global_chat_user_id);
                    }
                }
                
                // find a idle td to render the chat.
                var parent = null;
                $("#lst_chats").find("td").each(function(){
                    if ($(this).html() != "") {
                        return true;
                    }
                    
                    parent = $(this);
                    return false; // abort each
                });
                
                if (!parent) {
                    warn("没有可用的位置展示流。");
                    break;
                }
                $(parent).append(chat.ui);
                $(parent).parent().show();
                
                // when ui elements appent to the page,
                // create the player, or flash will failed.
                if (!chat.parent) {
                    chat.parent = $(parent);
                    
                    if (!no_play) {
                        // start the realtime player.
359
                        var _player = new SrsPlayer("rp_raw_" + chat.id, 240, 180, chat);
winlin authored
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393
                        _player.on_player_ready = function() {
                            this.set_bt(0.5);
                            this.play();
                        };
                        _player.on_player_metadata = function(metadata) {
                            this.set_dar(0, 0);
                            this.set_fs("screen", 100);
                        }
                        _player.start(chat.url);
                        
                        chat.player = _player;
                    } else {
                        chat.player = null;
                    }
                    
                    $(obj).find("#collapse_main").on('hidden', function(){
                        var id = $(this).parent().attr("chat_id");
                        var chat = get_previous_chat_user(previous_chats, id);
                        if (!chat || !chat.player) {
                            return;
                        }
                        chat.player.stop();
                    });
                    $(obj).find("#collapse_main").on('shown', function(){
                        var id = $(this).parent().attr("chat_id");
                        var chat = get_previous_chat_user(previous_chats, id);
                        if (!chat || !chat.player) {
                            return;
                        }
                        chat.player.play();
                    });
                }
            }
            
winlin authored
394 395 396 397 398 399 400 401
            previous_chats = chats;
        }
        function get_previous_chat_user(arr, id) {
            for (var i = 0; i < arr.length; i++) {
                var chat = arr[i];
                if (id == chat.id) {
                    return chat;
                }
402
            }
winlin authored
403
            return null;
404 405
        }
        
winlin authored
406
        function on_user_publish() {
407
            if ($("#txt_name").val() == "") {
winlin authored
408 409 410 411 412 413 414 415 416 417 418 419 420
                $("#txt_name").focus().parent().parent().addClass("error");
                warn(100, "请输入您的名字");
                return;
            }
            
            $("#txt_name").parent().parent().removeClass("error");
            
            // join chat.
            if (!self_chat) {
                on_user_join_chat();
            } else {
                on_user_exit_chat();
            }
421
        }
winlin authored
422 423 424
        function on_user_exit_chat(complete_pfn) {
            srs_publisher.stop();
            $("#btn_join").text("加入会议");
winlin authored
425 426 427 428
                
            if (realtime_player) {
                realtime_player.stop();
            }
winlin authored
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459
            
            if (!self_chat) {
                return;
            }
            
            // removed chat
            for (var i = 0; i < previous_chats.length; i++) {
                var chat = previous_chats[i];
                
                if (chat.player) {
                    chat.player.stop();
                }
                $("#div_" + chat.id).remove();
            }
            previous_chats = [];
            
            var url = api_server + "/" + self_chat.id;
            // whatever, cleanup local chat.
            self_chat = null;
            
            $("#btn_join").attr("disabled", true);
            
            // publish to api server to requires an id.
            $.ajax({
                type       : "DELETE",
                async      : true,
                url        : url,
                contentType: "text/html",
                data       : "",
                dataType   : "json",
                complete   : function() {
460 461 462 463
                    if (!on_publish_stop()) {
                        return;
                    }
            
winlin authored
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
                    $("#btn_join").attr("disabled", false);
                    if (complete_pfn) {
                        complete_pfn();
                    }
                },
                error      : function(ret) {
                    warn(103, "退出会议室失败");
                },
                success    : function(ret) {
                    if(0 != ret["code"]) {
                        warn(104, "退出会议室失败");
                        return;
                    }
                    info("退出会议室成功");
                }
            });
480
        }
winlin authored
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
        function on_user_join_chat(complete_pfn) {
            if (self_chat) {
                return;
            }
            
            var url = $("#txt_url").val();
            var vcodec = {};
            var acodec = {};
            srs_publiser_get_codec(
                vcodec, acodec,
                "#sl_cameras", "#sl_microphones", 
                "#sl_vcodec", "#sl_profile", "#sl_level", "#sl_gop", "#sl_size",
                "#sl_fps", "#sl_bitrate"
            );
            
            var chat = {};
            chat.id = -1;
498
            chat.username = $("#txt_name").val();
winlin authored
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535
            chat.agent = navigator.userAgent;
            chat.url = url;
            chat.vcodec = vcodec;
            chat.acodec = acodec;
            
            $("#btn_join").attr("disabled", true);
            
            // publish to api server to requires an id.
            $.ajax({
                type       : "POST",
                async      : true,
                url        : api_server,
                contentType: "text/html",
                data       : JSON.stringify(chat),
                dataType   : "json",
                complete   : function() {
                    $("#btn_join").attr("disabled", false);
                    if (complete_pfn) {
                        complete_pfn();
                    }
                },
                error      : function(ret) {
                    warn(105, "创建会议室失败:" + JSON.stringify(ret));
                },
                success    : function(ret) {
                    if(0 != ret["code"]) {
                        warn(106, "创建会议室失败: " + JSON.stringify(ret));
                        return;
                    }

                    chat.id = ret["data"];
                    
                    // success, start publish.
                    self_chat = chat;
                    
                    $("#btn_join").text("退出会议");
                
536
                    info("开始推流到服务器。请戴耳机聊天,否则音箱的声音会进入麦克风造成回声。");
winlin authored
537 538 539 540 541
                    srs_publisher.publish(url, vcodec, acodec);
                
                    if (realtime_player) {
                        // directly play the url for the realtime player.
                        realtime_player.stop();
542
                        realtime_player.play(url, 0);
winlin authored
543 544 545
                    }
                }
            });
546 547 548 549 550 551 552
        }
    </script>
</head>
<body>
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
553
            <a id="srs_index" class="brand" href="#">SRS</a>
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
            <div class="nav-collapse collapse">
                <ul class="nav">
                    <li><a id="nav_srs_player" href="srs_player.html">SRS播放器</a></li>
                    <li><a id="nav_srs_publisher" href="srs_publisher.html">SRS编码器</a></li>
                    <li class="active"><a id="nav_srs_chat" href="srs_chat.html">SRS会议</a></li>
                    <li><a id="nav_srs_bwt" href="srs_bwt.html">SRS测网速</a></li>
                    <li><a id="nav_jwplayer6" href="jwplayer6.html">JWPlayer6播放器</a></li>
                    <li><a id="nav_osmf" href="osmf.html">AdobeOSMF播放器</a></li>
                    <li><a id="nav_vlc" href="vlc.html">VLC播放器</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<div class="container">
winlin authored
569
    <!-- for the log -->
570 571 572
    <div class="alert alert-info fade in" id="txt_log">
        <button type="button" class="close" data-dismiss="alert">×</button>
        <strong><span id="txt_log_title">Usage:</span></strong>
573
        <span id="txt_log_msg">输入名字,设点“加入会议”按钮</span>
574
    </div>
winlin authored
575
    
576 577
    <div class="control-group">
        <div class="form-inline">
578 579 580 581
            <button class="btn input-small" id="btn_video_settings">摄像头</button>
            <button class="btn input-small" id="btn_audio_settings">麦克风</button>
            <input type="text" id="txt_name" class="input-large" placeholder="请输入您的名字..." value=""></input>
            <button class="btn input-small" id="btn_join">加入会议</button>
winlin authored
582
            <input type="text" id="txt_url" class="input-mini hide" value=""></input>
583 584
        </div>
    </div>
winlin authored
585 586
    <table id="lst_chats" class="table">
        <tr>
587
            <td id="td_0">
winlin authored
588 589
                <div class="accordion-group">
                    <div class="accordion-heading">
590
                        <span class="accordion-toggle">
winlin authored
591 592 593
                            <strong>[我的] 本地摄像头</strong>
                        </span>
                    </div>
594
                    <div class="accordion-body collapse in">
winlin authored
595 596 597 598 599
                        <div class="accordion-inner">
                            <div id="local_publisher"></div>
                        </div>
                    </div>
                </div>
winlin authored
600
            </td>
601
            <td id="td_1">
winlin authored
602 603
                <div class="accordion-group">
                    <div class="accordion-heading">
604
                        <span class="accordion-toggle">
winlin authored
605
                            <strong>[我的] 远程服务器流</strong>
606 607 608
                            <a id="realtime_player_url" href="#" data-toggle="tooltip" data-placement="top" title="">
                                播放地址<img src="img/tooltip.png"/>
                            </a>
winlin authored
609 610
                        </span>
                    </div>
611
                    <div class="accordion-body collapse in">
winlin authored
612 613 614 615 616
                        <div class="accordion-inner">
                            <div id="realtime_player"></div>
                        </div>
                    </div>
                </div>
winlin authored
617
            </td>
618
            <td id="td_2"></td>
winlin authored
619 620
        </tr>
    </table>
winlin authored
621 622 623 624 625 626
    <div class="container hide" id="template">
        <div class="accordion-group" id="collapse_main">
            <div class="accordion-heading" title="点击展开或收起,收起后停止播放流,展开时从服务器请求流">
                <span id="headerN" class="accordion-toggle" data-toggle="collapse" href="#collapseN">
                    <strong>[<a href="#"><span id="user_name">XX</span></a>]</strong>
                    <strong>加入时间</strong>[<span id="join_date"></span>]
627 628 629
                    <a id="user_player_url" href="#" data-toggle="tooltip" data-placement="top" title="">
                        播放地址<img src="img/tooltip.png"/>
                    </a>
winlin authored
630 631
                </span>
            </div>
winlin authored
632
            <div id="collapseM" class="accordion-body collapse in">
winlin authored
633
                <div class="accordion-inner">
winlin authored
634 635
                    <div id="chat_player">
                        <div id="chat_player_raw">
winlin authored
636 637 638 639
                        </div>
                    </div>
                </div>
            </div>
640 641
        </div>
    </div>
winlin authored
642
    <table class="table">
winlin authored
643
    </table>
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768
    <div id="video_modal" class="modal hide fade">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3>视频编码</h3>
        </div>
        <div class="modal-body">
            <div class="form-horizontal">
                <div class="control-group">
                    <label class="control-label" for="sl_cameras">
                        摄像头
                        <a id="sl_cameras_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span4" id="sl_cameras"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_vcodec">
                        Codec
                        <a id="sl_cameras_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_vcodec"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_profile">
                        Profile
                        <a id="sl_profile_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_profile"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_level">
                        Level
                        <a id="sl_level_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_level"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_gop">
                        GOP
                        <a id="sl_gop_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_gop"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_size">
                        尺寸
                        <a id="sl_size_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_size"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_fps">
                        帧率
                        <a id="sl_fps_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_fps"></select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="sl_bitrate">
                        码率
                        <a id="sl_bitrate_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_bitrate"></select>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">设置</button>
        </div>
    </div>
    <div id="audio_modal" class="modal hide fade">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3>音频编码</h3>
        </div>
        <div class="modal-body">
            <div class="form-horizontal">
                <div class="control-group">
                    <label class="control-label" for="sl_microphones">
                        麦克风
                        <a id="worker_id_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span4" id="sl_microphones"></select>
                    </div>
                </div>
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">设置</button>
        </div>
    </div>
winlin authored
769
    <hr/>
770 771 772 773 774 775
    <footer>
        <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team &copy; 2013</a></p>
    </footer>
</div>
</body>