Closed davidpino-gj closed 3 weeks ago
If I add the autoplay attribute (true or false) in my config prop, the play button dissapears but the issue remains.
config={{ file: { attributes: { autoplay: true, style: { position: 'static', objectFit: 'cover', height: '100%', width: '100%', }, }, }, }}
This is by Apple's design in iOS' Safari; I don't think there is a way around it. A user interaction is required to start the video.
Be sure to search for your issue before opening a new one.
Current Behavior
When my APP renders, the video from the MediaStream is being auto played and works just fine in all SO's and Devices, however, when my iPhone is on Saving Battery Mode, the video does not play and just shows a full blank container with a play button in the center (that doesn't work either)
Expected Behavior
The video should autoplay just fine in Saving Battery Mode
Environment
Other Information
Code Snippet:
<ReactPlayer url={mediaStream} height={'100%'} width={'100%'} controls={false} playing={true} muted={true} pip={isEnabled} playsinline={true} onEnablePIP={() => setEnabled(true)} onDisablePIP={() => { setEnabled(false) if (isIOS) { const videoTrack = CallService.getCurrentVideoTrack() const mediaStream = new MediaStream([videoTrack.getMediaStreamTrack()]) agoraDispatch({ type: 'setMediaStream', payload: { mediaStream: null, }, }) agoraDispatch({ type: 'setMediaStream', payload: { mediaStream, }, }) } }} config={{ file: { attributes: { style: { position: 'static', objectFit: 'cover', height: '100%', width: '100%', }, }, }, }} />