I have a .ts video file and player in Safari works great with it, but in Chrome, Firefox it doesn’t. Then I install mpegts.js videojs-mpegtsjs, but got an error with following code:
<template>
<div :style="'background:#fff; min-width: 640px; aspect-ratio:1920/1070;'">
<video
id="video-js-node"
class="vjs-matrix video-js"
controls
width="640"
preload="auto"
data-setup='{ "aspectRatio":"1920:1080", "playbackRates": [1, 1.5, 2] }'
>
<source :src="'path/to/video.ts'" type='video/mp2t' />
</video>
</div>
</template>
<script>
import { defineComponent, ref } from 'vue';
import videojs from 'video.js'
import 'videojs-mpegtsjs'
videojs('video-js-node', {
mpegtsjs: {
mediaDataSource: {
isLive: true,
cors: false,
withCredentials: false,
},
},
controls: 'control',
preload: 'auto',
height: '505',
});
export default defineComponent({
name: 'ArchivePlayer',
setup(){
return {
}
},
});
</script>
Maybe you know what’s the problem? Also I don’t quite understand why styles cannot connect to player