mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-09-27 03:25:56 +08:00
预览加入h265和mp3的解码支持
This commit is contained in:
25
dashboard/public/jessibuca/ff_mp3.js
Normal file
25
dashboard/public/jessibuca/ff_mp3.js
Normal file
File diff suppressed because one or more lines are too long
22
dashboard/public/jessibuca/hevc_aac.js
Normal file
22
dashboard/public/jessibuca/hevc_aac.js
Normal file
File diff suppressed because one or more lines are too long
21
dashboard/public/jessibuca/hevc_mp3.js
Normal file
21
dashboard/public/jessibuca/hevc_mp3.js
Normal file
File diff suppressed because one or more lines are too long
@@ -9,8 +9,8 @@
|
||||
>
|
||||
<canvas id="canvas" width="488" height="275" style="background: black" />
|
||||
<div slot="footer">
|
||||
<!-- 音频缓冲:-->
|
||||
<!-- <InputNumber v-model="audioBuffer" size="small"></InputNumber>-->
|
||||
<!-- 音频缓冲:-->
|
||||
<!-- <InputNumber v-model="audioBuffer" size="small"></InputNumber>-->
|
||||
<Button v-if="audioEnabled" @click="turnOff" icon="md-volume-off" />
|
||||
<Button v-else @click="turnOn" icon="md-volume-up"></Button>
|
||||
</div>
|
||||
@@ -21,26 +21,49 @@
|
||||
let h5lc = null;
|
||||
export default {
|
||||
name: "Jessibuca",
|
||||
props: {
|
||||
audioCodec: String,
|
||||
videoCodec: String
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
audioEnabled: false,
|
||||
// audioBuffer: 12,
|
||||
url: ""
|
||||
url: "",
|
||||
decoderTable: {
|
||||
AAC_AVC: "ff",
|
||||
AAC_H265: "hevc_aac",
|
||||
MP3_AVC: "ff_mp3",
|
||||
MP3_H265: "hevc_mp3"
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
audioEnabled(value) {
|
||||
h5lc.audioEnabled(value);
|
||||
},
|
||||
// audioBuffer(v) {
|
||||
// h5lc.audioBuffer = v;
|
||||
// }
|
||||
decoder(value) {
|
||||
if (h5lc) {
|
||||
h5lc.destroy();
|
||||
}
|
||||
h5lc = new window.Jessibuca({
|
||||
canvas: document.getElementById("canvas"),
|
||||
decoder: value
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
decoder() {
|
||||
return (
|
||||
"jessibuca/" +
|
||||
this.decoderTable[this.audioCodec + "_" + this.videoCodec] +
|
||||
".js"
|
||||
);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
h5lc = new window.Jessibuca({
|
||||
canvas: document.getElementById("canvas"),
|
||||
decoder: "jessibuca/ff.js",
|
||||
audioBuffer: this.audioBuffer
|
||||
decoder: "jessibuca/ff.js"
|
||||
});
|
||||
},
|
||||
destroyed() {
|
||||
|
@@ -181,8 +181,14 @@ export default {
|
||||
return item.SubscriberInfo ? item.SubscriberInfo.length : 0;
|
||||
},
|
||||
preview(item) {
|
||||
this.$refs.jessibuca.videoCodec = this.CodecID(item.VideoInfo.CodecID);
|
||||
this.$refs.jessibuca.audioCodec = this.SoundFormat(
|
||||
item.AudioInfo.SoundFormat
|
||||
);
|
||||
this.$nextTick(() =>
|
||||
this.$refs.jessibuca.play(
|
||||
"ws://" + location.hostname + ":8080/" + item.StreamPath
|
||||
)
|
||||
);
|
||||
this.showPreview = true;
|
||||
},
|
||||
|
Reference in New Issue
Block a user