referrer можно подменитьно кто знает что я реализовал так? но ваши идея тоже отлично...её добавлю в начале свою экшен. спасибо
<script class="splayer"> var params = {"playlist":[{"video":[{"url":"/cabinet/video/get-video?id=<?=$id?>"}],"duration":0,"posterUrl":"//s3.spruto.org/images/Sps_02_spruto_player_screen_1024.jpg"}],"uiLanguage":"ru","width":1024,"height":576,"design":{"skinName":"basic","color":{"scheme":"dark","buttonBg":"#333333","buttonNormal":"#cdff82","buttonHover":"#97a841"},"logo":{"imageUrl":"","clickUrl":"","position":"tr"},"hide":["shareCodeButton"]},"behavior":{"autoHideControlBar":true}}; player.embed(params); </script>
public function actionGetVideo(){
if (isset($this->get["id"]) && !empty(Yii::$app->request->referrer)) {
if (Url::base(true).'/video' == Yii::$app->request->referrer) {
$filename = Video::getVideoById($this->get["id"]);
if ($filename !== false) {
$storagePath = Yii::getAlias('@backend/web/uploads/video');
if (!is_file("$storagePath/$filename")) {
throw new \yii\web\NotFoundHttpException('The file does not exists.');
}
return Yii::$app->response->sendFile("$storagePath/$filename", $filename);
}
}
}
throw new \yii\web\NotFoundHttpException('The file does not exists.');
}
Request URL: kurs.loc/cabinet/video/get-video?id=4
Request Method: GET
Status Code: 206 Partial Content
генерируйте временные ссылкипопробую
Vue.mixin({
methods: {
myFunc(){
return 45 + 635 * 2433;
}
}
})
export default {
path: '/users',
component: Users,
children: [
{ path: 'list', component: List},
{ path: 'view', component: View}
]
}
const Post = r => require.ensure([], () => r(
require('@/views/post/')
), 'post-pages')
const PostView = r => require.ensure([], () => r(
require('@/views/post/view')
), 'post-pages')
const PostEdit = r => require.ensure([], () => r(
require('@/views/post/edit')
), 'post-pages')