1

im trying to stream videos from google drive but its not working

this is my code

func playVideo () {


    let url = NSURL(string: "https://drive.google.com/file/d/0B9XuPgWwSkzrdHN5WWUydjJScDg/preview")!

    let player = AVPlayer(URL: url)

    let playerViewController = AVPlayerViewController()

    playerViewController.player = player

    self.presentViewController(playerViewController, animated: true) {
        playerViewController.player?.play()
    }

}

i get this when i start the function image here

devzaid
  • 35
  • 2
  • 13
  • i found a way on android but i dont know how to do it on ios http://stackoverflow.com/a/33625394/5605581 – devzaid Aug 26 '16 at 05:27

2 Answers2

1

i solved the problem by Decodeing the html from the link and take the steam link from it

you can see the code here : https://github.com/DevZaid/GDSLink

devzaid
  • 35
  • 2
  • 13
0

your link is to flash video, not to some video supported by AVPlayer.

user3441734
  • 16,722
  • 2
  • 40
  • 59
  • and how i can get the video supported by AVPlayer ?? – devzaid Jun 29 '16 at 23:11
  • from your link? there is no way. To see what kind of video is supported by AVPlayer I suggest you to check apple documentation or http://stackoverflow.com/questions/21879981/avfoundation-avplayer-supported-formats-no-vob-or-mpg-containers – user3441734 Jun 30 '16 at 07:57