fix linting errors

This commit is contained in:
DispatchCommit 2021-01-25 15:50:11 -08:00 committed by Sean Yesmunt
parent ee28648852
commit 52f883be4e

View file

@ -376,9 +376,6 @@ export default React.memo<Props>(function VideoJs(props: Props) {
displayCurrentQuality: true, displayCurrentQuality: true,
}); });
// Add reference to player to global scope
window.player = player;
// fixes #3498 (https://github.com/lbryio/lbry-desktop/issues/3498) // fixes #3498 (https://github.com/lbryio/lbry-desktop/issues/3498)
// summary: on firefox the focus would stick to the fullscreen button which caused buggy behavior with spacebar // summary: on firefox the focus would stick to the fullscreen button which caused buggy behavior with spacebar
player.on('fullscreenchange', () => document.activeElement && document.activeElement.blur()); player.on('fullscreenchange', () => document.activeElement && document.activeElement.blur());
@ -391,6 +388,9 @@ export default React.memo<Props>(function VideoJs(props: Props) {
const vjsElement = createVideoPlayerDOM(containerRef.current); const vjsElement = createVideoPlayerDOM(containerRef.current);
const vjsPlayer = initializeVideoPlayer(vjsElement); const vjsPlayer = initializeVideoPlayer(vjsElement);
// Add reference to player to global scope
window.player = vjsPlayer;
// Add event listener for keyboard shortcuts // Add event listener for keyboard shortcuts
window.addEventListener('keydown', handleKeyDown); window.addEventListener('keydown', handleKeyDown);
@ -402,7 +402,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
player.dispose(); player.dispose();
window.player = undefined; window.player = undefined;
} }
} };
}, []); }, []);
// Update video player and reload when source URL changes // Update video player and reload when source URL changes
@ -429,7 +429,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
// Update player poster // Update player poster
// note: the poster prop seems to return null usually. // note: the poster prop seems to return null usually.
if ( poster ) player.poster(poster); if (poster) player.poster(poster);
// Update player source // Update player source
player.src({ player.src({