-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18ee631
commit 7d416f7
Showing
12 changed files
with
131 additions
and
682 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<div class="page"> | ||
<div> | ||
<el-input v-model="inputUrl"></el-input> | ||
<el-button @click="onPlay">播放url</el-button> | ||
</div> | ||
<hls-player ref="hlsPlayer" v-bind="hlsPlayerAttrs"></hls-player> | ||
</div> | ||
</template> | ||
|
||
<script lang='jsx'> | ||
import { reactive, toRefs, defineComponent, onMounted } from 'vue' | ||
import 'hls-player.js' | ||
import { tauri } from "@tauri-apps/api" | ||
export default defineComponent({ | ||
components: {}, | ||
setup (props, ctx) { | ||
const state = reactive({ | ||
// https://hls-js.netlify.app/demo/ | ||
inputUrl: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8', | ||
hlsPlayer: null, | ||
hlsPlayerAttrs: { | ||
options: {debug: false, autoplay: true, muted: true}, | ||
events: { | ||
onLoadSegmentDataBuffer: async (segment, dataBuffer) => { | ||
// console.log(11, segment, dataBuffer); | ||
}, | ||
} | ||
}, | ||
onPlay() { | ||
state.hlsPlayer.src = state.inputUrl | ||
} | ||
}) | ||
onMounted(async () => { | ||
state.hlsPlayer.shadowRoot.querySelector('video').style = 'max-width: 100%;' | ||
state.onPlay() | ||
}) | ||
return { ...toRefs(state) } | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
hls-player { | ||
max-width: 100%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters