jwplayer / JWPlayerKit-cocoapod

Other
2 stars 6 forks source link

Premium License: black screen with audio for videos has extension .m3u8 #8

Closed iSallyAbdallah closed 11 months ago

iSallyAbdallah commented 1 year ago

Hi JWPlayer Team

i try to play .m3u8 video , and gives me black screen and premium license using latest vision pod 'JWPlayerKit', '>= 4.13.0'

`## Code:


class ViewController: JWPlayerViewController {

    private let videoUrlString = "https://v.w-x.co/digital_video/The_Weather_Channel_-_Reach_Engine/9e04336c-b152-4f8b-a543-acf1f0ae1f51/061623_FLASH_FLOODING_IMPACTSmezz_Playlist.m3u8"
    private let posterUrlString = "https://d3el35u4qe4frz.cloudfront.net/bkaovAYt-480.jpg"

    override func viewDidLoad() {
        super.viewDidLoad()

        // Set the view's background color to black for better contrast.
        view.backgroundColor = .black

        // Set up the player.
        setUpPlayer()
    }

    /**
     Sets up the player with a simple configuration.
     */
    private func setUpPlayer() {
        let videoUrl = URL(string:videoUrlString)!
        let posterUrl = URL(string:posterUrlString)!

        // First, use the JWPlayerItemBuilder to create a JWPlayerItem that will be used by the player configuration.
        let playerItembuilder = JWPlayerItemBuilder()
            .file(videoUrl)
            .posterImage(posterUrl)
        var playerItem: JWPlayerItem!
        do {
            playerItem = try playerItembuilder.build()
        } catch {
            // Handle player item build failure
            print(error.localizedDescription)
            return
        }

        // Second, create a player config with the created JWPlayerItem.
        let configBuilder = JWPlayerConfigurationBuilder()
            .playlist(items: [playerItem])
            .autostart(true)
        var config: JWPlayerConfiguration!
        do {
            config = try configBuilder.build()
        } catch {
            // Handle player item build failure
            print(error.localizedDescription)
            return
        }

        // Lastly, use the created JWPlayerConfiguration to set up the player.
        player.configurePlayer(with: config)
    }
}

Result:

video with audio

Simulator Screenshot - iPhone 14 Pro - 2023-06-22 at 19 15 47