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
e0ec2da2
Commit
e0ec2da2
authored
Nov 01, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
00d6c581
a9c57066
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
17 deletions
+28
-17
CourseController.php
src/backend/controllers/CourseController.php
+4
-1
detail.php
src/backend/views/course/detail.php
+8
-1
QiniuTranscode.php
src/common/libs/QiniuTranscode.php
+3
-2
MyCourseController.php
src/frontend/controllers/MyCourseController.php
+2
-4
center.php
src/frontend/views/layouts/center.php
+9
-8
edit.js
src/frontend/web/js/my-course/edit.js
+2
-1
No files found.
src/backend/controllers/CourseController.php
View file @
e0ec2da2
...
...
@@ -77,8 +77,11 @@ class CourseController extends Controller
$qiniu
=
\Yii
::
$app
->
qiniu
;
$previewUrl
=
$qiniu
->
getUrl
(
'public'
,
$course
->
preview_pic
);
$sourceUrl
=
$qiniu
->
getUrl
(
'video'
,
$courseware
->
name
);
$baseUrl
=
$qiniu
->
getStorageConfig
(
'video'
,
'url'
)
.
$courseware
->
name
;
$avUrl
=
$qiniu
->
getAuthInstance
()
->
privateDownloadUrl
(
$baseUrl
.
'?avinfo'
);
return
$this
->
render
(
'detail'
,
compact
(
'course'
,
'courseware'
,
'class'
,
'previewUrl'
,
'sourceUrl'
));
return
$this
->
render
(
'detail'
,
compact
(
'course'
,
'courseware'
,
'class'
,
'previewUrl'
,
'sourceUrl'
,
'avUrl'
));
}
/**
...
...
src/backend/views/course/detail.php
View file @
e0ec2da2
<?php
/**
* @var $class \common\models\Classes
* @var $course \common\models\Course
* @var $previewUrl string
* @var $sourceUrl string
* @var $avUrl string
*/
use
yii\helpers\Html
;
...
...
@@ -11,4 +15,7 @@ $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
<p>
[
<a
href=
"
<?=
$sourceUrl
?>
"
target=
"_blank"
>
下载源视频
</a>
]
[
<a
href=
"
<?=
$avUrl
?>
"
target=
"_blank"
>
AVINFO
</a>
]
</p>
\ No newline at end of file
src/common/libs/QiniuTranscode.php
View file @
e0ec2da2
...
...
@@ -145,8 +145,9 @@ class QiniuTranscode
//FPS 对比
//Todo: 目前FPS的测算方法都不是很正确,不管是 r_frame_rate 还是 avg_frame_rate 多种情况下结果不正确,还需要继续研究
//因为预算不是很正确,所以在 FPS 在于目标值并超过 10 以上时才转换
$frate
=
explode
(
'/'
,
$video
[
'avg_frame_rate'
]);
if
(
$frate
[
0
]
/
$frate
[
1
]
>
$target
[
'fps'
])
{
if
(
$frate
[
0
]
/
$frate
[
1
]
>
$target
[
'fps'
]
+
10
)
{
$fopsMain
.=
'/r/'
.
$target
[
'fps'
];
}
...
...
@@ -191,7 +192,7 @@ class QiniuTranscode
$fops
=
''
;
//如果视频不是目标格式,或有必要参数,则进行转码
if
(
$force
||
strpos
(
$avInfo
[
'format'
][
'format_name'
],
self
::
TARGET_FORMAT
)
===
false
)
{
if
(
$force
||
$fopsMain
||
strpos
(
$avInfo
[
'format'
][
'format_name'
],
self
::
TARGET_FORMAT
)
===
false
)
{
$fops
=
'avthumb/'
.
self
::
TARGET_FORMAT
.
$fopsMain
.
$fopsAddon
;
}
...
...
src/frontend/controllers/MyCourseController.php
View file @
e0ec2da2
...
...
@@ -263,9 +263,7 @@ class MyCourseController extends \yii\web\Controller
}
//保存课程数据
if
(
!
$course
->
update
())
{
Utils
::
ajaxResponse
(
false
,
'课程保存失败'
);
}
$course
->
update
();
//保存讲师与课程关联数据
CourseTeacher
::
autoSaveRelations
(
$course
->
id
,
$form
->
teacher
);
...
...
@@ -304,7 +302,7 @@ class MyCourseController extends \yii\web\Controller
AttachUpload
::
claimTmpAttachs
(
$form
->
tmp
,
'course:'
.
$course
->
id
);
Utils
::
ajaxResponse
(
true
,
null
,
[
'course_id'
=>
$course
->
id
]);
Utils
::
ajaxResponse
(
true
,
null
,
[
'course_id'
=>
$course
->
id
,
'recheck'
=>
$recheck
]);
}
/**
...
...
src/frontend/views/layouts/center.php
View file @
e0ec2da2
...
...
@@ -51,14 +51,15 @@ $this->registerCss('[v-cloak] {display:none;}');
?>
<?php
$this
->
beginPage
()
?>
<!DOCTYPE html>
<html
lang=
"
<?=
\Yii
::
$app
->
language
?>
"
>
<html
lang=
"
<?=
\Yii
::
$app
->
language
?>
"
>
<head>
<meta
charset=
"
<?=
Yii
::
$app
->
charset
?>
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
<?=
$this
->
title
?
Html
::
encode
(
$this
->
title
)
.
'-'
:
''
?>
云涯
</title>
<?=
Html
::
csrfMetaTags
()
?>
<?php
$this
->
head
()
?>
<meta
charset=
"
<?=
Yii
::
$app
->
charset
?>
"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<title>
<?=
(
$this
->
title
?
Html
::
encode
(
$this
->
title
)
.
'-'
:
''
)
?>
云涯
</title>
<link
rel=
"shortcut icon"
href=
"
<?=
AppAsset
::
getStaticUrl
(
'img/favicon.ico'
)
?>
"
>
<?=
Html
::
csrfMetaTags
()
?>
<?php
$this
->
head
()
?>
</head>
<body>
<?php
$this
->
beginBody
();
?>
...
...
@@ -122,4 +123,4 @@ $this->registerCss('[v-cloak] {display:none;}');
<?php
$this
->
endBody
();
?>
</body>
</html>
<?php
$this
->
endPage
();
?>
<?php
$this
->
endPage
();
?>
\ No newline at end of file
src/frontend/web/js/my-course/edit.js
View file @
e0ec2da2
...
...
@@ -66,7 +66,8 @@ var vm = new Vue({
time
:
2000
,
icon
:
1
,
end
:
function
()
{
location
.
href
=
"/my-course/"
;
location
.
href
=
t
.
data
.
recheck
?
"/my-course/result?id="
+
t
.
data
.
course_id
+
"&action=edit"
:
"/my-course/"
;
},
shade
:[
0.2
,
'#000'
]
});
...
...
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