Closed phpb-com closed 2 years ago
This error only pops-up on the client side, and I am using ReactJS 18.2.0
Ah, thanks, I will wait for the next npm release before bumping the version then.
Thanks, I have been tracking your changes closely, I hope I did not miss anything else. ;-)
v1.0.28 released.
Tested and it works as expected, thanks and you are the best! 💯
Ok, sorry, but I have to take the part about "all works" back. I just did the test on the iPad and iPhone, and get the following error:
h4@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:4562:61
Fe2@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:4567:61
_e@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:4856:22
Tt@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:5540:5
@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:3995:29
forEach@[native code]
@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:3994:25
@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:3934:77
@http://127.0.0.1:8788/build/routes/video/$videoId-EW6Q7TAW.js:5607:53
commitAttachRef@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:16813:29
commitLayoutEffectOnFiber@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:16696:32
commitLayoutMountEffects_complete@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:17506:42
commitLayoutEffects_begin@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:17495:48
commitLayoutEffects@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:17447:36
commitRootImpl@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:18851:32
commitRoot@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:18775:27
finishConcurrentRender@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:18304:25
performConcurrentWorkOnRoot@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:18218:37
performConcurrentWorkOnRoot@[native code]
workLoop@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:200:50
flushWork@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:179:30
performWorkUntilDeadline@http://127.0.0.1:8788/build/entry.client-B7WEPQOE.js:387:50
When deployed in "prod", I get:
g@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:180:72192
bl@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:180:3403
Ol@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:208:78415
oc@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:310:96000
@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:18:49635
forEach@[native code]
@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:18:49614
@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:6:47849
@https://example.com/build/routes/video/$videoId-BYQJ4PNE.js:310:97691
Mi@https://example.com/build/entry.client-PRWD2PB5.js:8:101051
Qo@https://example.com/build/entry.client-PRWD2PB5.js:8:109172
Ua@https://example.com/build/entry.client-PRWD2PB5.js:8:108071
Qf@https://example.com/build/entry.client-PRWD2PB5.js:8:107617
Gf@https://example.com/build/entry.client-PRWD2PB5.js:8:117470
hn@https://example.com/build/entry.client-PRWD2PB5.js:8:116822
Va@https://example.com/build/entry.client-PRWD2PB5.js:8:112320
Va@[native code]
El@https://example.com/build/entry.client-PRWD2PB5.js:1:1742
yl@https://example.com/build/entry.client-PRWD2PB5.js:1:2133
(URL is replaced with example.com
, sorry but it is still WiP.
This error happens when I go to the page with the player in it. Work on a desktop (Chrome) though,
What about https://oplayer.vercel.app ?
I cannot get valid information from the error
https://oplayer.vercel.app/ - work, but the difference is Remix app here. Something to do with the native code leaking into client side, I would speculate. I'll try to see if removing some of the code in-between the commits will help and narrow down on the issue (if I can).
Can you provide the code to call oplayer?
That I can, and I think I kinda know what might be the problem:
import ui from '@oplayer/ui'
import hls from '@oplayer/hls'
import ReactPlayer from '@oplayer/react'
import type { ReactOPlayerProps } from '@oplayer/react'
import type { HlsConfig } from 'hls.js'
import {
isEmbedded,
isIOS,
isIOS13,
isIPad13,
isIPhone13,
isIPod13,
isMobile,
isMobileSafari,
isSmartTV,
isWearable,
} from 'react-device-detect'
export function OPlayer(props: ReactOPlayerProps) {
const hlsConfig: Partial<HlsConfig> = {
debug: false,
capLevelOnFPSDrop: true,
capLevelToPlayerSize: true,
manifestLoadingTimeOut: 10000,
manifestLoadingMaxRetry: 4,
manifestLoadingRetryDelay: 1000,
manifestLoadingMaxRetryTimeout: 64000,
levelLoadingTimeOut: 10000,
levelLoadingMaxRetry: 4,
levelLoadingRetryDelay: 1000,
levelLoadingMaxRetryTimeout: 64000,
fragLoadingTimeOut: 20000,
fragLoadingMaxRetry: 6,
fragLoadingRetryDelay: 1000,
fragLoadingMaxRetryTimeout: 64000,
testBandwidth: true,
maxAudioFramesDrift: 1,
// Buffer configuration
maxBufferLength: 10,
maxMaxBufferLength: 20,
}
const plugins = [
hls({ hlsConfig: hlsConfig }),
ui({
theme: { primaryColor: '#BC0011' },
airplay: true,
pictureInPicture: true,
miniProgressBar: true,
autoFocus: true,
screenshot:
isIOS ||
isIOS13 ||
isIPhone13 ||
isIPod13 ||
isIPad13 ||
isMobileSafari ||
isSmartTV ||
isWearable ||
isEmbedded ||
isMobile
? false
: true,
speed: ['2', '1.5', '1', '0.5'],
fullscreen: true,
fullscreenWeb:
isIOS || isIOS13 || isMobileSafari || isSmartTV || isWearable
? false
: true,
hotkey: true,
}),
]
return (
<ReactPlayer
plugins={plugins}
{...props}
/>
)
}
Ok, the problem is here:
fullscreenWeb:
isIOS || isIOS13 || isMobileSafari || isSmartTV || isWearable
? false
: true,
When set to true, all works as expected.
Is this an oplayer error?
I think so, something to do with disablement of the fullscreenWeb. I had similar issue in the past but you fixed it with some other changes, so I never bothered you with that.
To be clear if I go from
speed: ['2', '1.5', '1', '0.5'],
fullscreen: true,
fullscreenWeb:
isIOS || isIOS13 || isMobileSafari || isSmartTV || isWearable
? false
: true,
hotkey: true,
to
speed: ['2', '1.5', '1', '0.5'],
fullscreen: true,
fullscreenWeb: true,
hotkey: true,
everything starts working again.
Wait, I found the reason for the error.
Setting it to false on the desctop results in:
TypeError: Cannot read properties of null (reading 'removeAttribute')
at h4 (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:4562:62)
at Fe2 (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:4567:59)
at _e (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:4856:19)
at Tt (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:5540:3)
at Object.apply (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:5555:18)
at http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:3995:24
at Set.forEach (<anonymous>)
at I.<anonymous> (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:3994:18)
at I.create (http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:3934:73)
at http://127.0.0.1:8788/build/routes/video/$videoId-UH56RKTP.js:5607:47
Ah, we posted at the same time. Yes, I guess this error message is a better one.
A new version has been released, try it out and thanks for the feedback!
1.0.29 works with false and true for fullscreenWeb
. Thanks for being awesome and fixing it!
import ui from '@oplayer/ui'
//....
/* Put it on top or wrap it in moemo */
const hlsConfig: Partial<HlsConfig> = { }
const plugins = [ ]
/* * ** * */
export function OPlayer(props: ReactOPlayerProps) {
return (
<ReactPlayer
plugins={plugins}
{...props}
/>
)
}
Yes, that is a good point. I moved it in later on to potentially pass props to the element. Never got to it yet :-(
Currently they(plugins
) are not responsive and the update will do nothing
True, I had to find it out the hard way ;-) Thanks for spotting the bug in my code that caused some headaches already
Hi again,
I ran into issues with my Remix React app after the upgrade to 1.0.27. This error pos-up once I click through to the video and then try to go back to the home page clicking the navigation. I did not look too deeply yet, but though it would help if I report it first. You may have an idea why.