mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-03 20:35:17 +00:00
hack-y solution to losing player context
use a global window variable to store the reference to the current video.js instance.
This commit is contained in:
parent
68ae2d571f
commit
d8564cda5a
1 changed files with 3 additions and 1 deletions
|
@ -170,7 +170,7 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
type: sourceType,
|
type: sourceType,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
autoplay: false,
|
autoplay: true,
|
||||||
poster: poster, // thumb looks bad in app, and if autoplay, flashing poster is annoying
|
poster: poster, // thumb looks bad in app, and if autoplay, flashing poster is annoying
|
||||||
plugins: {
|
plugins: {
|
||||||
eventTracking: true,
|
eventTracking: true,
|
||||||
|
@ -414,6 +414,8 @@ export default React.memo<Props>(function VideoJs(props: Props) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// For some reason the video player is responsible for detecting content type this way
|
// For some reason the video player is responsible for detecting content type this way
|
||||||
fetch(source, { method: 'HEAD' }).then(response => {
|
fetch(source, { method: 'HEAD' }).then(response => {
|
||||||
|
const player = window.player;
|
||||||
|
|
||||||
if (!player) {
|
if (!player) {
|
||||||
console.log(`Our player was disposed, we should disregard the fetch result.`);
|
console.log(`Our player was disposed, we should disregard the fetch result.`);
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue