123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <include file="public@header" />
- </head>
- <body>
- <div class="wrap">
- <ul class="nav nav-tabs">
- <li ><a href="{:url('Liveing/index')}">直播列表</a></li>
- <li class="active"><a >{:lang('ADD')}</a></li>
- </ul>
- <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Liveing/addPost')}">
- <div class="form-group">
- <label for="input-uid" class="col-sm-2 control-label"><span class="form-required">*</span>用户ID</label>
- <div class="col-md-6 col-sm-10">
- <input type="text" class="form-control" id="input-uid" name="uid">
- </div>
- </div>
- <div class="form-group" id="liveclass">
- <label for="input-type" class="col-sm-2 control-label"><span class="form-required">*</span>直播分类</label>
- <div class="col-md-6 col-sm-10">
- <select class="form-control" name="liveclassid">
- <option value="0">默认分类</option>
- <volist name="liveclass" id="v">
- <option value="{$key}">{$v}</option>
- </volist>
- </select>
- </div>
- </div>
- <div class="form-group" id="type">
- <label for="input-type" class="col-sm-2 control-label"><span class="form-required">*</span>房间类型</label>
- <div class="col-md-6 col-sm-10">
- <select class="form-control" name="type" id="cdn">
- <volist name="type" id="v">
- <option value="{$key}">{$v}</option>
- </volist>
- </select>
- </div>
- </div>
- <div class="form-group" id="cdn_switch_1" style="display:none;">
- <label for="input-type_val" class="col-sm-2 control-label"><span class="form-required">*</span>密码或价格</label>
- <div class="col-md-6 col-sm-10">
- <input type="text" class="form-control" id="input-type_val" name="type_val">
- </div>
- </div><br>
- <div class="form-group">
- <label class="col-sm-2 control-label"></label>
- <label class="col-md-6 col-sm-10">
- <a href="#" id="getLivePushUrl" >单机一键获取——播流地址、推流地址、TaskId</a>
- </label>
- </div>
- <div class="form-group">
- <label for="input-TaskId" class="col-sm-2 control-label"><span class="form-required">*</span>云直播TaskId</label>
- <div class="col-md-6 col-sm-10">
- <input type="text" class="form-control" id="input-TaskId" name="TaskId" value="">TaskId
- </div>
- </div>
- <div class="form-group">
- <label for="input-pull" class="col-sm-2 control-label"><span class="form-required">*</span>播流地址</label>
- <div class="col-md-6 col-sm-10">
- <input type="text" class="form-control" id="input-pull" name="pull" value="">播流格式:MP4
- </div>
- </div>
- <div class="form-group">
- <label for="input-push" class="col-sm-2 control-label"><span class="form-required">*</span>推流地址</label>
- <div class="col-md-6 col-sm-10">
- <input type="text" class="form-control" id="input-push" name="push" value="">推流格式:MP4
- </div>
- </div>
- <div class="form-group" id="anyway">
- <label for="input-words" class="col-sm-2 control-label"><span class="form-required">*</span>视频类型</label>
- <div class="col-md-6 col-sm-10">
- <select class="form-control" name="anyway">
- <option value="0">竖屏</option>
- </select>
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-offset-2 col-sm-10">
- <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
- <a class="btn btn-default" href="{:url('Liveing/index')}">{:lang('BACK')}</a>
- </div>
- </div>
- </form>
- </div>
- <script src="__STATIC__/js/admin.js"></script>
- <script>
- (function(){
- $("#cdn").on('change',function(){
- var v=$(this).val();
- var b=$("#cdn_switch_1");
- if(v==0){
- b.hide();
- $("#input-type_val").val('');
- }else{
- b.show();
- }
- })
- $("#live_type").on('change',function(){
- var v=$(this).val();
- if(v==0){
- $("#liveclass").show();
- $("#type").show();
- $("#anyway").show();
- }else{
- $("#liveclass").hide();
- $("#type").hide();
- $("#anyway").hide();
- }
- });
- // 点击 获取推流地址 ,异步请求接口
- $("#getLivePushUrl").on('click', function () {
- var uid = $('#input-uid').val();
- // 检查值是否为空或者非数字
- if (uid === '' || isNaN(uid)) {
- alert('请输入正确的UID(数字)');
- } else {
- // console.log('UID:', uid);
- $.ajax({
- url: '/admin/liveing/getLivePushUrl.html',
- type: 'POST',
- data: {
- uid: uid,
- },
- dataType: 'json',
- success: function (data) {
- $('#input-TaskId').val(data.TaskId);
- $('#input-push').val(data.push);
- $('#input-pull').val(data.pull);
- console.log('请求成功:', data);
- },
- error: function (error) {
- console.error('请求失败:', error);
- }
- });
- }
- })
- })()
- </script>
- </body>
- </html>
|