

<div class="layui-form" lay-filter="layuiadmin-form" >
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">通道名称</label>
        <div class="layui-input-inline">
            <input type="text" name="rtsp_name" placeholder="名称唯一" maxlength="100" lay-verify="required" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">取流器</label>
        <div class="layui-input-inline">
            <select name="collector" id="collector"  lay-verify="required">
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">rtsp地址</label>
        <div class="layui-input-inline" style="width:400px">
            <textarea name="rtsp_url" placeholder="rtsp://..." onkeydown="checkEnter(event)" maxlength="1024" lay-verify="required" class="layui-textarea"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">推流地址</label>
        <div class="layui-input-inline" style="width:400px">
            <textarea name="rtmp_url" placeholder="rtmp://... 视频支持H264,音频支持PCMA/PCMU" onkeydown="checkEnter(event)" maxlength="1024"  class="layui-textarea"/>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" lay-submit lay-filter="LAY-front-submit" value="确认" class="layui-btn">
        </div>
    </div>
</div>

<script>
    layui.use(['admin', 'video', 'form'], function () {
        var $ = layui.$
        , form = layui.form;

        //加载取流器
        function bindCollector() {
            var _collector = $('#collector');
            _collector.empty();
            _collector.append("<option value='0' >默认取流器</option>");
            _collector.append("<option value='1' >旧版取流器</option>");
        }
        bindCollector();
    })
    function checkEnter(e) {
        var et = e || window.event;
        var keycode = et.charCode || et.keyCode;
        if (keycode == 13) {
            if (window.event) {
                window.event.returnValue = false;
            } else {
                e.preventDefault();
            }
        }
    }
</script>