Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
8a9b6ee2
Commit
8a9b6ee2
authored
Oct 26, 2016
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
视频码率参数调整
详情页增加一点内容
parent
e345e5a0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
CourseController.php
src/backend/controllers/CourseController.php
+6
-1
detail.php
src/backend/views/course/detail.php
+14
-0
QiniuTranscode.php
src/common/libs/QiniuTranscode.php
+2
-4
No files found.
src/backend/controllers/CourseController.php
View file @
8a9b6ee2
...
...
@@ -53,8 +53,13 @@ class CourseController extends Controller
$courseware
=
Courseware
::
findOne
([
'course_id'
=>
$course
->
id
]);
$class
=
Classes
::
findOne
([
'id'
=>
$course
->
class_id
]);
/* @var $qiniu \common\components\Qiniu */
$qiniu
=
\Yii
::
$app
->
qiniu
;
$previewUrl
=
$qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
);
$sourceUrl
=
$qiniu
->
getUrl
(
'video'
,
$courseware
->
name
);
return
$this
->
render
(
'detail'
,
compact
(
'course'
,
'courseware'
,
'class'
));
return
$this
->
render
(
'detail'
,
compact
(
'course'
,
'courseware'
,
'class'
,
'previewUrl'
,
'sourceUrl'
));
}
/**
...
...
src/backend/views/course/detail.php
0 → 100644
View file @
8a9b6ee2
<?php
/**
* @var $course \common\models\Course
*/
use
yii\helpers\Html
;
$this
->
title
=
$course
->
name
;
?>
<p>
<?=
$class
->
name
?>
</p>
<div><img
src=
"
<?=
$previewUrl
?>
-m.preview"
></div>
<div>
<?=
$course
->
intro
?>
</div>
<p>
[
<a
href=
"
<?=
$sourceUrl
?>
"
target=
"_blank"
>
下载源视频
</a>
]
</p>
\ No newline at end of file
src/common/libs/QiniuTranscode.php
View file @
8a9b6ee2
...
...
@@ -176,10 +176,8 @@ class QiniuTranscode
$fopsAddon
.=
'/ar/'
.
$target
[
'ar'
];
}
//视频采样率对比
//if ($video['bit_rate'] > $target['vb']) {
$fopsAddon
.=
'/vb/'
.
$target
[
'vb'
];
//}
//视频采样率对比,七牛文档指出如果给出的码率大于原码率,则会使用原码率转换,但某些视频仍然会出现码率变大,所以此处加上判断
$fopsAddon
.=
'/vb/'
.
(
$video
[
'bit_rate'
]
>
$target
[
'vb'
]
?
$target
[
'vb'
]
:
$video
[
'bit_rate'
]);
//编码对比
if
(
$video
[
'codec_name'
]
!=
'h264'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment