Skip to content

Commit

Permalink
Fix: m3u8 live source
Browse files Browse the repository at this point in the history
  • Loading branch information
zijiren233 committed Oct 10, 2023
1 parent 4ef8872 commit b54049f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/components/MoviePush.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ const movieTypeRecords: Map<pushType, movieTypeRecord> = new Map([
{
name: "m3u8",
value: "m3u8"
},
{
name: "ts",
value: "mpegts"
}
]
}
Expand Down
17 changes: 14 additions & 3 deletions src/views/Cinema.vue
Original file line number Diff line number Diff line change
Expand Up @@ -624,11 +624,22 @@ const danmukuPlugin = artplayerPluginDanmuku({
speed: 4
});
const playerUrl = computed(() => {
if (room.currentMovie.pullKey) {
switch (room.currentMovie.type) {
case "m3u8":
return `${window.location.origin}/api/movie/live/${room.currentMovie.pullKey}.m3u8`;
default:
return `${window.location.origin}/api/movie/live/${room.currentMovie.pullKey}.flv`;
}
} else {
return room.currentMovie.url;
}
});
const playerOption = computed(() => {
return {
url: room.currentMovie.pullKey
? `${window.location.origin}/api/movie/live/${room.currentMovie.pullKey}.flv`
: room.currentMovie.url,
url: playerUrl.value,
isLive: room.currentMovie.live,
type: parseVideoType(room.currentMovie),
headers: room.currentMovie.headers,
Expand Down

0 comments on commit b54049f

Please sign in to comment.