JWPlayerDelegate

@objc
public protocol JWPlayerDelegate

A protocol which must be used to monitor errors within the JWPlayer instance.

  • When the player is fully initialized, this method is called on the delegate.

    Declaration

    Swift

    func jwplayerIsReady(_ player: JWPlayer)

    Parameters

    player

    The player which initialized successfully.

  • When the player encounters an error with playback, this method is called on the delegate.

    Declaration

    Swift

    func jwplayer(_ player: JWPlayer, failedWithError code: UInt, message: String)

    Parameters

    player

    The player generating the error.

    code

    The numerical code representing the error.

    message

    A human-readable description of the error.

  • When the player encounters an error during setup and initialization, this method is called on the delegate.

    Declaration

    Swift

    func jwplayer(_ player: JWPlayer, failedWithSetupError code: UInt, message: String)

    Parameters

    player

    The player generating the error.

    code

    The numerical code representing the error.

    message

    A human-readable description of the error.

  • When the player encounters a warning within the SDK, this method is called on the delegate.

    Declaration

    Swift

    func jwplayer(_ player: JWPlayer, encounteredWarning code: UInt, message: String)

    Parameters

    player

    The player generating the error.

    code

    The numerical code representing the warning.

    message

    A human-readable description of the warning.

  • When the player encounters an ad warning within the SDK, this method is called on the delegate. Ad warnings do not prevent the ad from continuing to play.

    Declaration

    Swift

    func jwplayer(_ player: JWPlayer, encounteredAdWarning code: UInt, message: String)

    Parameters

    player

    The player generating the warning.

    code

    The numerical code representing the ad warning.

    message

    A human-readable description of the warning.

  • When the player encounters an ad error within the SDK, this method is called on the delegate. Ad errors prevent ads from playing, but do not prevent media playback from continuing.

    Declaration

    Swift

    func jwplayer(_ player: JWPlayer, encounteredAdError code: UInt, message: String)

    Parameters

    player

    The player generating the error.

    code

    The numerical code representing the ad error.

    message

    A human-readable description of the error.