Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端新增ts视频预览;config.yml添加out_put_tmpl示例 #783

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ live_rooms:
- url: https://live.bilibili.com/22603245
is_listening: true
quality: 0
out_put_tmpl: ""
out_put_tmpl: ''
# '{{ .Live.GetPlatformCNName }}/{{ .HostName | filenameFilter }}/[{{ now | date "2006-01-02 15-04-05"}}][{{ .HostName | filenameFilter }}][{{ .RoomName | filenameFilter }}].flv'
# ./平台名称/主播名字/[时间戳][主播名字][房间名字].flv
# https://github.com/hr3lxphr6j/bililive-go/wiki/More-Tips
video_split_strategies:
on_room_name_changed: false
max_duration: 0s
Expand Down
18 changes: 17 additions & 1 deletion src/webapp/src/component/file-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@ class FileList extends React.Component<Props, IState> {
}
}
},
ts: function (video, url) {
if (mpegtsjs.isSupported()) {
const tsPlayer = mpegtsjs.createPlayer({
type: "mpegts", // could also be mpegts, m2ts, flv,mse
url: url,
hasVideo: true,
hasAudio: true,
}, {});
tsPlayer.attachMediaElement(video);
tsPlayer.load();
} else {
if (art) {
art.notice.show = "不支持播放格式: mpegts";
}
}
},
},
});
});
Expand Down Expand Up @@ -227,4 +243,4 @@ class FileList extends React.Component<Props, IState> {
}
}

export default FileList;
export default FileList;