Skip to content

Commit

Permalink
Check response.ok instead of response.status
Browse files Browse the repository at this point in the history
  • Loading branch information
miko committed Jan 15, 2025
1 parent aa6bfe5 commit 24982ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/component/viewers/videoViewer/internal/videojs.jsx
Original file line number Diff line number Diff line change
@@ -482,7 +482,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
trimmedUrl = trimmedUrl.toString();

// change to m3u8 if applicable
if (response && response.redirected && response.url && trimmedUrl.endsWith('m3u8') && response.status === 200) {
if (response && response.redirected && response.url && trimmedUrl.endsWith('m3u8') && response.ok) {
vjsPlayer.claimSrcVhs = { type: HLS_FILETYPE, src: response.url };
vjsPlayer.src(vjsPlayer.claimSrcVhs);

@@ -492,7 +492,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
}

// Log possible errors
if (response.status >= 400) {
if (!response.ok) {
Lbryio.call('event', 'desktop_error', {
error_message: `PlayerSourceLoadError: Url: ${response.url}
| Redirected: ${String(response.redirected)}

0 comments on commit 24982ef

Please sign in to comment.