Initial import
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
/* @var $this \yii\web\View */
|
||||
/* @var $id */
|
||||
$decode = \app\services\JWT::decode($id, \app\services\JWT::SECRET_KEY);
|
||||
$file = \app\models\RegisterObjectFiles::findOne($decode->id);
|
||||
|
||||
?>
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<?= $this->render('/_mobile_view_mode') ?>
|
||||
<?php if ($file && $file->streaming_url): ?>
|
||||
|
||||
<video id="video_play" style="width: 100%; height: 100%; position: absolute: top: 0; left: 0; background: #000000" controls autoplay></video>
|
||||
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
|
||||
<script>
|
||||
|
||||
var videoSrc = '<?= $file->streaming_url ?>';
|
||||
var video = document.querySelector('#video_play');
|
||||
|
||||
//
|
||||
// First check for native browser HLS support
|
||||
//
|
||||
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
||||
|
||||
//alert('Test 1')
|
||||
video.src = videoSrc;
|
||||
//
|
||||
// If no native HLS support, check if HLS.js is supported
|
||||
//
|
||||
//video.play();
|
||||
} else if (Hls.isSupported()) {
|
||||
var hls = new Hls();
|
||||
hls.loadSource(videoSrc);
|
||||
hls.attachMedia(video);
|
||||
} else {
|
||||
alert('hls is not supported on your browser')
|
||||
}
|
||||
|
||||
video.volume = 0.4
|
||||
video.play();
|
||||
|
||||
</script>
|
||||
|
||||
<?php endif ?>
|
||||
Reference in New Issue
Block a user