vimeo / VIMVideoPlayer

Deprecated: Please use [PlayerKit]( https://github.com/vimeo/PlayerKit) instead.
MIT License
281 stars 63 forks source link

Cannot Open #72

Open syedrazackimran opened 6 years ago

syedrazackimran commented 6 years ago

Issue Summary

A brief but thorough description of the issue. vimeoPlayer.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: self.videoPlayer.bounds.height) vimeoPlayer.delegate = self self.videoPlayer.addSubview(vimeoPlayer) vimeoPlayer.player.disableAirplay() if let url = URL(string: "https://player.vimeo.com/video/12765955") { vimeoPlayer.player.setURL(url) } vimeoPlayer.player.isLooping = false vimeoPlayer.setVideoFillMode(AVLayerVideoGravity.resizeAspectFill.rawValue) vimeoPlayer.player.player.play()

Above Code, I'm using to play Vimeo Video. When is ready to play I'm getting error Message

Video player Status Failed: player item error = Error Domain=AVFoundationErrorDomain Code=-11828 "Cannot Open" UserInfo={NSLocalizedFailureReason=This media format is not supported., NSLocalizedDescription=Cannot Open, NSUnderlyingError=0x1c0856680 {Error Domain=NSOSStatusErrorDomain Code=-12847 "(null)"}}

I check with URL link on Browser is fine it's working on the browser. kindly do needfully

Reproduction Steps

Detailed steps to reproduce the issue.

Expected Behavior

What do you expect to happen as a result of the reproduction steps?

Actual Behavior

What currently happens as a result of the reproduction steps?

Veniso commented 5 years ago

The below code worked for me to resolve this error.

let mimeType = "video/mp4; codecs=\"avc1.42E01E, mp4a.40.2\""

            // create asset
            let asset = AVURLAsset(url: videoURL!, options: ["AVURLAssetOutOfBandMIMETypeKey": mimeType])