Blame view

trunk/research/players/srs_chat.html 30.8 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
                    cameras, microphones,
                    "#sl_cameras", "#sl_microphones", 
                    "#sl_vcodec", "#sl_profile", "#sl_level", "#sl_gop", "#sl_size",
winlin authored
85 86
                    "#sl_fps", "#sl_bitrate",
                    "#sl_acodec"
winlin authored
87
                );
88 89
            };
            srs_publisher.on_publisher_error = function(code, desc) {
90 91 92 93
                if (!on_publish_stop()) {
                    return;
                }
                
94
                error(code, desc + "请重试。");
95 96 97 98 99 100
            };
            srs_publisher.on_publisher_warn = function(code, desc) {
                warn(code, desc);
            };
            srs_publisher.start();
            
101 102
            update_play_url();
            
winlin authored
103
            if (!no_play) {
104
                // start the realtime player.
105
                realtime_player = new SrsPlayer("realtime_player", 280, 180);
106
                realtime_player.on_player_ready = function() {
107
                    this.set_bt(0.5);
108
                };
winlin authored
109 110 111
                realtime_player.on_player_metadata = function(metadata) {
                    this.set_dar(0, 0);
                    this.set_fs("screen", 100);
112 113
                    
                    info("推流到服务器成功。请戴耳机聊天,否则音箱的声音会进入麦克风造成回声。");
winlin authored
114
                }
115 116
                realtime_player.start();
            }
winlin authored
117
            
118 119
            $("#txt_name").focus();
            
winlin authored
120 121
            api_server = "http://" + query.hostname + ":" + srs_get_api_server_port() + "/api/v1/chats";
            refresh();
122 123
        });
        
124 125 126 127 128 129 130 131 132 133 134 135
        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;
        }
        
136 137 138 139 140 141
        function update_play_url() {
            var url = $("#txt_url").val();
            
            $("#realtime_player_url").attr("href", url).attr("target", "_blank");
        }
        
winlin authored
142 143 144 145 146
        function refresh() {
            if (!self_chat) {
                setTimeout(refresh, 1000);
                return;
            }
147
            
winlin authored
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 174
            $.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);
                }
            });
175
        }
winlin authored
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
        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("重新加入会议室成功");
                    });
                });
197 198 199
                return;
            }
            
winlin authored
200
            render_chat_room(chats);
201
            
winlin authored
202 203 204
            if (!self_chat) {
                return;
            }
205
            
winlin authored
206 207
            // update self heartbeat.
            var url = api_server + "/" + self_chat.id;
208
            
winlin authored
209 210
            var chat = {};
            chat.localtime = new Date().getTime();
211
            
winlin authored
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232
            // 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
233
        function render_chat_room(original_chats) {
winlin authored
234 235 236
            if (!self_chat) {
                return;
            }
237
            
winlin authored
238 239 240 241
            var chats = [];
            for (var i = 0; i < original_chats.length; i++) {
                var chat = original_chats[i];
                
winlin authored
242 243 244 245 246
                // ignore the self.
                if (self_chat && self_chat.id == chat.id) {
                    continue;
                }
                
winlin authored
247 248 249 250 251 252 253
                chats.push(chat);
            }
            
            // new added chat
            for (var i = 0; i < chats.length; i++) {
                var chat = chats[i];
                
winlin authored
254 255 256
                // if previous exists, ignore, only add new here.
                var previous_chat = get_previous_chat_user(previous_chats, chat.id);
                if (previous_chat) {
257
                    // update reference.
winlin authored
258 259
                    chat.ui = previous_chat.ui;
                    chat.parent = previous_chat.parent;
winlin authored
260
                    chat.player = previous_chat.player;
winlin authored
261 262
                    if (chat.player) {
                        chat.player.private_object = chat;
winlin authored
263
                    }
winlin authored
264
                    continue;
winlin authored
265 266
                }
            }
267
            
winlin authored
268 269 270 271 272 273 274 275 276 277 278 279 280
            // 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();
281 282
            }
            
winlin authored
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 327
            // 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);
328
                        $(obj).find("#user_player_url").attr("href", chat.url);
329
                        $(obj).find("#join_date").text(chat.join_date_str.split(" ")[1]);
winlin authored
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 359
                        $(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.
360
                        var _player = new SrsPlayer("rp_raw_" + chat.id, 240, 180, chat);
winlin authored
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 394
                        _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
395 396 397 398 399 400 401 402
            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;
                }
403
            }
winlin authored
404
            return null;
405 406
        }
        
winlin authored
407
        function on_user_publish() {
408
            if ($("#txt_name").val() == "") {
winlin authored
409 410 411 412 413 414 415 416 417 418 419 420 421
                $("#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();
            }
422
        }
winlin authored
423 424 425
        function on_user_exit_chat(complete_pfn) {
            srs_publisher.stop();
            $("#btn_join").text("加入会议");
winlin authored
426 427 428 429
                
            if (realtime_player) {
                realtime_player.stop();
            }
winlin authored
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 460
            
            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() {
461 462 463 464
                    if (!on_publish_stop()) {
                        return;
                    }
            
winlin authored
465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
                    $("#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("退出会议室成功");
                }
            });
481
        }
winlin authored
482 483 484 485 486 487 488 489 490 491 492 493
        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",
winlin authored
494 495
                "#sl_fps", "#sl_bitrate",
                "#sl_acodec"
winlin authored
496 497 498 499
            );
            
            var chat = {};
            chat.id = -1;
500
            chat.username = $("#txt_name").val();
winlin authored
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 536 537
            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("退出会议");
                
538
                    info("开始推流到服务器。请戴耳机聊天,否则音箱的声音会进入麦克风造成回声。");
winlin authored
539 540 541 542 543
                    srs_publisher.publish(url, vcodec, acodec);
                
                    if (realtime_player) {
                        // directly play the url for the realtime player.
                        realtime_player.stop();
544
                        realtime_player.play(url, 0);
winlin authored
545 546 547
                    }
                }
            });
548 549 550 551 552 553 554
        }
    </script>
</head>
<body>
<div class="navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
555
            <a id="srs_index" class="brand" href="#">SRS</a>
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570
            <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
571
    <!-- for the log -->
572 573 574
    <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>
575
        <span id="txt_log_msg">输入名字,设点“加入会议”按钮</span>
576
    </div>
winlin authored
577
    
578 579
    <div class="control-group">
        <div class="form-inline">
580 581 582 583
            <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
584
            <input type="text" id="txt_url" class="input-mini hide" value=""></input>
585 586
        </div>
    </div>
winlin authored
587 588
    <table id="lst_chats" class="table">
        <tr>
589
            <td id="td_0">
winlin authored
590 591
                <div class="accordion-group">
                    <div class="accordion-heading">
592
                        <span class="accordion-toggle">
winlin authored
593 594 595
                            <strong>[我的] 本地摄像头</strong>
                        </span>
                    </div>
596
                    <div class="accordion-body collapse in">
winlin authored
597 598 599 600 601
                        <div class="accordion-inner">
                            <div id="local_publisher"></div>
                        </div>
                    </div>
                </div>
winlin authored
602
            </td>
603
            <td id="td_1">
winlin authored
604 605
                <div class="accordion-group">
                    <div class="accordion-heading">
606
                        <span class="accordion-toggle">
winlin authored
607
                            <strong>[我的] 远程服务器流</strong>
608 609 610
                            <a id="realtime_player_url" href="#" data-toggle="tooltip" data-placement="top" title="">
                                播放地址<img src="img/tooltip.png"/>
                            </a>
winlin authored
611 612
                        </span>
                    </div>
613
                    <div class="accordion-body collapse in">
winlin authored
614 615 616 617 618
                        <div class="accordion-inner">
                            <div id="realtime_player"></div>
                        </div>
                    </div>
                </div>
winlin authored
619
            </td>
620
            <td id="td_2"></td>
winlin authored
621 622
        </tr>
    </table>
winlin authored
623 624 625 626 627 628
    <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>]
629 630 631
                    <a id="user_player_url" href="#" data-toggle="tooltip" data-placement="top" title="">
                        播放地址<img src="img/tooltip.png"/>
                    </a>
winlin authored
632 633
                </span>
            </div>
winlin authored
634
            <div id="collapseM" class="accordion-body collapse in">
winlin authored
635
                <div class="accordion-inner">
winlin authored
636 637
                    <div id="chat_player">
                        <div id="chat_player_raw">
winlin authored
638 639 640 641
                        </div>
                    </div>
                </div>
            </div>
642 643
        </div>
    </div>
winlin authored
644
    <table class="table">
winlin authored
645
    </table>
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
    <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>
winlin authored
765 766 767 768 769 770 771 772 773 774 775
                <div class="control-group">
                    <label class="control-label" for="sl_acodec">
                        编码
                        <a id="sl_acodec_tips" href="#" data-toggle="tooltip" data-placement="right" title="">
                            <img src="img/tooltip.png"/>
                        </a>
                    </label>
                    <div class="controls">
                        <select class="span2" id="sl_acodec"></select>
                    </div>
                </div>
776 777 778 779 780 781
            </div>
        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" data-dismiss="modal" aria-hidden="true">设置</button>
        </div>
    </div>
winlin authored
782
    <hr/>
783 784 785 786 787 788
    <footer>
        <p><a href="https://github.com/winlinvip/simple-rtmp-server">SRS Team &copy; 2013</a></p>
    </footer>
</div>
</body>