react-native-video: [BUG]: CoreMediaErrorDomain Error -12971 on iOS

Version

5.2.1

What platforms are you having the problem on?

iOS

System Version

16.6.1, 14.7.1

On what device are you experiencing the issue?

Real device

Architecture

Old architecture

What happened?

A bug happened!

I am trying to play an HLS stream using the React Native Video player (underneath it’s using AvPlayer). I am able to play the stream smoothly, but in some cases the player can not play the stream properly.

Error details from react-native-video player:

  • Error Code: -12971

  • Domain: CoreMediaErrorDomain

  • Localised Description: The operation couldn’t be completed. (CoreMediaErrorDomain error -12971.)

  • Target: 2457

Stream Configuration:

Image

The error does not provide a specific failure reason or recovery suggestion, which makes troubleshooting challenging.

Video Player for iOS:

<VideoPlayer
                    source={{ uri: this.props.streamURL}}
                    key={this.props.streamURL}
                    videoRef={(ref) => this.videoRef = ref}
                    disableFullscreen={false}
                    playInBackground={true}
                    disableSeekbar
                    disableVolume
                    muted = {false}
                    disablePlayPause={false}
                    disableTimer
                    disableBack
                    disableSeekButtons
                    showOnStart={true}
                    paused={this.paused}
                    resizeMode="contain"
                    toggleResizeModeOnFullscreen={false}
                    videoStyle={styles.backgroundVideo}
                    controlTimeoutDelay={this.controlTimeoutDelay}
                    automaticallyWaitsToMinimizeStalling = {true}
                    preferredForwardBufferDuration={1} 
                    onBuffer={(buffer) => {
                        console.log("!8989 ", buffer)
                    }}
                    onBufferEnd={(buffer) => {
                        console.log("!8989 buffer end")
                    }}
                    onHideControls={()=> {
                        this.onShowControls = false 
                        this.updateState()
                    }}
                    onShowControls={() => {
                        this._showPlayerController()
                    }}
                    onError={(error)=>{
                        this.props.videoPlaybackError(error, this.staticClockTime)
                    }}
                    isFullscreen={this.isFullscreenOn}
                    fullscreenAutorotate={true}
                    fullscreenOrientation="all"
                    onEnterFullscreen={() => {
                        if (this.videoRef === this.state.videoRef) {
                            console.log("!8989 onEnterFullscreen ", this.isFullscreenOn)
                            if(this.isFullscreenOn) {
                                this.isFullscreenOn = false
                                this.renderScaleUiNonFullsreenMode(SCREEN_WIDTH, SCREEN_HEIGHT)
                                this.props.didTapOnExitFullscreen(this.isFullscreenOn)
                                this.updateState()
                            } else {
                                this.isFullscreenOn = true
                                this.renderScaleUiNonFullsreenMode(SCREEN_HEIGHT, SCREEN_WIDTH)
                                this.props.didTapOnFullscreen(this.isFullscreenOn)
                                this.updateState()
                            }
                        }
                    }}
                    onLoadStart= {() => {
                        this.isStreaming = true
                        this._startClockTimer()
                        this.setState({videoRef: this.videoRef})
                    }} 
                    onLoad={(data) => {
                        this.props.onVideoLoaded()
                    }}
                    onEnd={() => {
                        this.onLoaded = false
                    }}
                    onPause={() => {
                        this.paused = true
                        this.isVodActivated = true 
                        this.updateState()
                    }}
                    onPlay={() => {
                        if (this.videoRef === this.state.videoRef) {
                            this.clockTime = this.staticClockTime
                            this.paused = false
                            this.updateState()
                        }
                    }}
                /> 

Reproduction Link

repository link https://github.com/LunatiqueCoder/react-native-media-console

Reproduction

Step to reproduce this bug are:
Load VIdeoPlayer With a HLS stream url. After few seconds of playing its throwing the error.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15

Most upvoted comments

Also facing same issue, Is there any solution ?