Commit cb1e646d by 杨昕

Merge branch 'test' into 'master'

Test

See merge request !34
parents 9535bd0a 4496dcf8
Pipeline #13885 passed with stages
in 40 seconds
......@@ -381,6 +381,10 @@ function getRbac($request,$url='api/ram',$appid = '' ,$type='base'){
$rbac_url = $rbac.'/cdn/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak;
break;
case 'play_m3u8':
$rbac_url = $rbac.'/chain/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&mediaId='.$appid.'&pathForever=1';
break;
default:
$rbac_url = $rbac.'/rbac/'.$url.'?t='.$time.'&sign='.$sign.'&ak='.$rbac_ak.'&appid='.$appid.'&uid='.$mis_uid;
......
......@@ -293,5 +293,14 @@ class MediaController extends Controller
}
public function getMediaForeverM3u8(Request $request){
$data = handler_drive(function () use ($request) {
return MediaModel::getMediaForeverM3u8($request);
});
return success($data);
}
}
......@@ -903,4 +903,48 @@ class MediaModel extends Eloquent
}
/**
* 获取永久m3u8地址
* @param $request
* @param $media_id
* @return mixed
* @throws DatabaseException
*/
public static function getMediaForeverM3u8($request){
try{
$media_id = $request->media_id;
/**
* 判断媒资ID是否存在
*/
$media = MediaModel::where("_id",$media_id)->first();
if (empty($media)){
throw new \Exception("媒资信息不存在");
}
$media_type = $media['media_type_id'];
$mediaCatg = MediaCategoryModel::where('_id',$media_type)->first();
if (empty($mediaCatg)){
throw new \Exception("媒资类别不存在");
}
$url = getRbac($request,'video/info',$media_id ,$type='play_m3u8');
$res = http_request_code($url,null,'GET');
$result = json_decode($res,true);
if ($result['code'] != 0){
LogModel::addlog($result);
throw new \Exception("获取数据失败");
}
}catch (\Exception $exception){
throw new DatabaseException($exception->getMessage());
}
return $result['data'];
}
}
......@@ -3,7 +3,8 @@
<head>
<meta charset="utf-8"/>
<title>IconFont Demo</title>
<link rel="shortcut icon" href="https://img.alicdn.com/tps/i4/TB1_oz6GVXXXXaFXpXXJDFnIXXX-64-64.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="//img.alicdn.com/imgextra/i2/O1CN01ZyAlrn1MwaMhqz36G_!!6000000001499-73-tps-64-64.ico" type="image/x-icon"/>
<link rel="icon" type="image/svg+xml" href="//img.alicdn.com/imgextra/i4/O1CN01EYTRnJ297D6vehehJ_!!6000000008020-55-tps-64-64.svg"/>
<link rel="stylesheet" href="https://g.alicdn.com/thx/cube/1.3.2/cube.min.css">
<link rel="stylesheet" href="demo.css">
<link rel="stylesheet" href="iconfont.css">
......@@ -31,6 +32,24 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe615;</span>
<div class="name">清除缓存</div>
<div class="code-name">&amp;#xe615;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe668;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe668;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62d;</span>
<div class="name">清除</div>
<div class="code-name">&amp;#xe62d;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe627;</span>
<div class="name">屏幕_全屏</div>
<div class="code-name">&amp;#xe627;</div>
......@@ -447,6 +466,33 @@
<ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-qingchuhuancun"></span>
<div class="name">
清除缓存
</div>
<div class="code-name">.icon-qingchuhuancun
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-fuzhi"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-qingchu"></span>
<div class="name">
清除
</div>
<div class="code-name">.icon-qingchu
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-fullScreen"></span>
<div class="name">
屏幕_全屏
......@@ -1026,6 +1072,30 @@
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-qingchuhuancun"></use>
</svg>
<div class="name">清除缓存</div>
<div class="code-name">#icon-qingchuhuancun</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-qingchu"></use>
</svg>
<div class="name">清除</div>
<div class="code-name">#icon-qingchu</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fullScreen"></use>
</svg>
<div class="name">屏幕_全屏</div>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,27 @@
"description": "",
"glyphs": [
{
"icon_id": "10121085",
"name": "清除缓存",
"font_class": "qingchuhuancun",
"unicode": "e615",
"unicode_decimal": 58901
},
{
"icon_id": "2366778",
"name": "复制",
"font_class": "fuzhi",
"unicode": "e668",
"unicode_decimal": 58984
},
{
"icon_id": "954336",
"name": "清除",
"font_class": "qingchu",
"unicode": "e62d",
"unicode_decimal": 58925
},
{
"icon_id": "19657959",
"name": "屏幕_全屏",
"font_class": "fullScreen",
......
......@@ -20,6 +20,15 @@ Created by iconfont
/>
<missing-glyph />
<glyph glyph-name="qingchuhuancun" unicode="&#58901;" d="M361.5 13.9c-21.2 0-38.4 17.2-38.4 38.4V206c0 21.2 17.2 38.4 38.4 38.4s38.4-17.2 38.4-38.4v-153.6c0-21.3-17.2-38.5-38.4-38.5zM822.3 321.2H207.9c-63.5 0-115.2 51.7-115.2 115.2v38.4c0 63.5 51.7 115.2 115.2 115.2h614.5c63.5 0 115.2-51.7 115.2-115.2v-38.4c-0.1-63.6-51.7-115.2-115.3-115.2z m-614.4 192c-21.2 0-38.4-17.2-38.4-38.4v-38.4c0-21.2 17.2-38.4 38.4-38.4h614.5c21.2 0 38.4 17.2 38.4 38.4v38.4c0 21.2-17.2 38.4-38.4 38.4H207.9zM745.5-5.3H284.7c-63.5 0-115.2 51.7-115.2 115.2V359.6c0 21.2 17.2 38.4 38.4 38.4h614.5c21.2 0 38.4-17.2 38.4-38.4V110c-0.1-63.6-51.7-115.3-115.3-115.3zM246.3 321.2V110c0-21.2 17.2-38.4 38.4-38.4h460.8c21.2 0 38.4 17.2 38.4 38.4V321.2H246.3zM611.1 513.2h-192c-21.2 0-38.4 17.2-38.4 38.4V666.8c0 63.5 51.7 115.2 115.2 115.2h38.4c63.5 0 115.2-51.7 115.2-115.2v-115.2c0-21.2-17.2-38.4-38.4-38.4zM457.5 590h115.2v76.8c0 21.2-17.2 38.4-38.4 38.4h-38.4c-21.2 0-38.4-17.2-38.4-38.4V590zM515.1 13.9c-21.2 0-38.4 17.2-38.4 38.4V206c0 21.2 17.2 38.4 38.4 38.4s38.4-17.2 38.4-38.4v-153.6c0-21.3-17.2-38.5-38.4-38.5zM668.7 13.9c-21.2 0-38.4 17.2-38.4 38.4V206c0 21.2 17.2 38.4 38.4 38.4s38.4-17.2 38.4-38.4v-153.6c0-21.3-17.2-38.5-38.4-38.5z" horiz-adv-x="1024" />
<glyph glyph-name="fuzhi" unicode="&#58984;" d="M896 725.333333H298.666667c-70.4 0-128-57.6-128-128v-597.333333c0-70.4 57.6-128 128-128h597.333333c70.4 0 128 57.6 128 128V597.333333c0 70.4-57.6 128-128 128m0-85.333333c23.125333 0 42.666667-19.541333 42.666667-42.666667v-597.333333c0-23.125333-19.541333-42.666667-42.666667-42.666667H298.666667c-23.125333 0-42.666667 19.541333-42.666667 42.666667V597.333333c0 23.125333 19.541333 42.666667 42.666667 42.666667h597.333333M170.666667 128h-42.666667c-23.125333 0-42.666667 19.541333-42.666667 42.666667V768c0 23.125333 19.541333 42.666667 42.666667 42.666667h597.333333c23.125333 0 42.666667-19.541333 42.666667-42.666667v-42.496h85.333333V768c0 70.4-57.6 128-128 128H128C57.6 896 0 838.4 0 768v-597.333333c0-70.4 57.6-128 128-128h42.666667V128zM554.666667 128V469.333333c0 23.466667 19.2 42.666667 42.666666 42.666667s42.666667-19.2 42.666667-42.666667v-341.333333c0-23.466667-19.2-42.666667-42.666667-42.666667s-42.666667 19.2-42.666666 42.666667M768 256H426.666667c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666666h341.333333c23.466667 0 42.666667-19.2 42.666667-42.666666s-19.2-42.666667-42.666667-42.666667" horiz-adv-x="1024" />
<glyph glyph-name="qingchu" unicode="&#58925;" d="M511.706311 831.978894C264.433578 831.978894 63.981197 631.52549 63.981197 384.254803s200.451358-447.724091 447.724091-447.724091c247.270686 0 447.724091 200.453405 447.724091 447.724091S758.976998 831.978894 511.706311 831.978894zM752.447281 202.877873c16.396435-16.382109 16.396435-42.971697 0-59.353806-8.197706-8.197706-18.937305-12.297071-29.676903-12.297071s-21.479197 4.099365-29.676903 12.297071L511.711428 324.906114 330.328357 143.523043c-8.197706-8.197706-18.937305-12.297071-29.676903-12.297071-10.739599 0-21.479197 4.099365-29.676903 12.297071-16.396435 16.382109-16.396435 42.971697 0 59.353806L452.356598 384.25992 270.974551 565.641967c-16.396435 16.382109-16.396435 42.971697 0 59.353806 16.396435 16.396435 42.958394 16.396435 59.353806 0L511.711428 443.613726l181.382047 181.382047c16.396435 16.396435 42.957371 16.396435 59.353806 0 16.396435-16.382109 16.396435-42.971697 0-59.353806L571.065234 384.25992 752.447281 202.877873z" horiz-adv-x="1024" />
<glyph glyph-name="fullScreen" unicode="&#58919;" d="M628.053333 267.94666700000005a32 32 0 0 0 45.226667 0l158.72-158.634667V202.66666699999996l0.298667 4.352A32 32 0 0 0 896 202.66666699999996v-181.333334l-0.341333-3.84a21.333333 21.333333 0 0 0-20.992-17.493333h-181.333334l-4.352 0.298667a32 32 0 0 0-27.648 31.701333l0.298667 4.352a32 32 0 0 0 31.701333 27.648h93.44l-158.72 158.72-3.114666 3.584a32 32 0 0 0 3.114666 41.642667z m-232.106666 0a32 32 0 0 0 3.114666-41.642667l-3.114666-3.584-158.72-158.72h93.44a32 32 0 0 0 31.701333-27.648l0.298667-4.352a32 32 0 0 0-27.648-31.701333L330.666667 0H149.333333a21.333333 21.333333 0 0 0-20.992 17.493333L128 21.33333300000004v181.333334a32 32 0 0 0 63.701333 4.352l0.298667-4.352v-93.354667l158.72 158.634667a32 32 0 0 0 45.226667 0zM874.666667 768a21.333333 21.333333 0 0 0 20.992-17.493333L896 746.666667v-181.333334a32 32 0 0 0-63.701333-4.352L832 565.333333V658.688L673.28 500.053333a32 32 0 0 0-48.341333 41.642667l3.114666 3.584 158.72 158.72h-93.44a32 32 0 0 0-31.701333 27.648L661.333333 736a32 32 0 0 0 27.648 31.701333L693.333333 768h181.333334zM330.666667 768l4.352-0.298667a32 32 0 0 0 27.648-31.701333l-0.298667-4.352a32 32 0 0 0-31.701333-27.648H237.226667l158.72-158.72 3.114666-3.584a32 32 0 0 0-48.341333-41.642667L192 658.688V565.333333l-0.298667-4.352A32 32 0 0 0 128 565.333333V746.666667l0.341333 3.84A21.333333 21.333333 0 0 0 149.333333 768h181.333334z" horiz-adv-x="1024" />
......
......@@ -59,6 +59,7 @@
<th>视频地址</th>
<th>创建时间</th>
<th>媒资号码</th>
<th>时长(s)</th>
<th>操作</th>
</tr>
</thead>
......@@ -79,6 +80,12 @@
@else
<td></td>
@endif
@if(isset($media['duration']))
<td style="max-width: 100px;">{{$media['duration']}}</td>
@else
<td></td>
@endif
<td class="td-manage">
@if(permissionExist("manager_media","media_edit"))
......@@ -112,7 +119,11 @@
@endif
<a title="清除cdn缓存" onclick="clear_cdn_cache(this,'{{$media["_id"]}}')" href="javascript:;">
<i class="iconfont">&#xe61c;</i>
<i class="iconfont">&#xe615;</i>
</a>
<a title="获取永久播放地址" id="{{$media["_id"]}}" data-toggle="modal" data-target=".bd-example-modal-lg" onclick="get_farvor_m3u8(this,'{{$media["_id"]}}')" href="javascript:;">
<i class="iconfont">&#xe668;</i>
</a>
</td>
......@@ -149,6 +160,7 @@
{{--<link rel="stylesheet" href="{{ asset('xadmin/extra/toast/css/toast.css')}}">--}}
<script src="{{ asset('xadmin/js/jquery.validate.js')}}"></script>
<script type="text/javascript" src="http://www.jq22.com/demo/clipboard.js-master201703170013/dist/clipboard.min.js"></script>
<script type="text/javascript">
......@@ -368,8 +380,40 @@
});
})
function get_farvor_m3u8(row,media_id) {
$.ajax({
url:"/api/user/get_fervor_m3u8?media_id="+media_id,
dataType:"json",
success:function (res) {
var url = res.data.url;
$('.modal-content').html(url)
}
})
}
</script>
<div class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content"></div>
</div>
</div>
<style>
.model{
z-index: 9999;
}
.modal-content{
word-break: break-word;
top: 100px;
padding: 20px;
}
</style>
</body>
</html>
\ No newline at end of file
......@@ -48,6 +48,7 @@ Route::group(['namespace' => 'Api', 'prefix' => 'user','middleware' => ['api']],
Route::get('update_datetime', 'MediaController@updateDatetime');
Route::get("get_media_by_num",'MediaController@getMediaInfoByNum');
Route::get("get_fervor_m3u8",'MediaController@getMediaForeverM3u8');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment