• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Video not playing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Video not playing


  • Subject: Video not playing
  • From: Jonathan Hull <email@hidden>
  • Date: Sun, 24 May 2015 22:08:37 -0700

Hello Cocoa Devs,

I am a bit stumped by this, but hopefully it is an easy answer to someone who has worked with videos more.

The effect I am trying to achieve is having an image of a video showing among other elements, and when the user taps the video it zooms to fullscreen and plays.

Here is my attempt:

            let player = MPMoviePlayerController(contentURL: videoURL)
            player.prepareToPlay()
            player.view.frame = frame //This is defined above as the stillFrame’s frame
            self.view.addSubview(player.view)
            player.setFullscreen(true, animated: true)
            player.play()

This does the zoom, but the video just shows “Loading…” indefinitely.  I know that the video url is correct and that the video can play because this code works (it just doesn’t do the zoom):

            let player = MPMoviePlayerViewController(contentURL: videoURL)
            player.moviePlayer.prepareToPlay()
            player.moviePlayer.play()
            self.presentMoviePlayerViewControllerAnimated(player)

Any idea what is going on here?  Am I missing something simple in the first example?

Thanks,
Jon
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Prev by Date: Constraining window width to scrolling contents with autolayout
  • Next by Date: Re: Constraining window width to scrolling contents with autolayout
  • Previous by thread: Re: Constraining window width to scrolling contents with autolayout
  • Next by thread: 10.10 replacement for SMJobCopyDictionary
  • Index(es):
    • Date
    • Thread