Skip to content

Commit

Permalink
503 になったとき、リロード確認のダイアログを出すようにした。
Browse files Browse the repository at this point in the history
VIDEO要素のぐるぐるを止めるのは難しいらしい。
  • Loading branch information
plonk committed Dec 8, 2021
1 parent 797fbbd commit 333ca1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ui/Templates/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@
isLive: true,
url: '/stream/{$page.channel.id}.flv'
});
flvPlayer.on('error', (errorType, errorCode, details) => {
let msg = `エラーが起きたので動画が再生できませんでした。\n` +
`ページをリロードしますか?\n` +
`\n` +
`${errorType}\n${errorCode}\n${JSON.stringify(details)}`;
if (window.confirm(msg)) {
window.location.reload();
}
});
flvPlayer.attachMediaElement(videoElement);
flvPlayer.load();
flvPlayer.play().catch(error => {
Expand Down

0 comments on commit 333ca1b

Please sign in to comment.