Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-08-2011, 07:21 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 56
vivendi is on a distinguished road
Default play video

I want to play a video in the normal video player that comes with the iOS.
But the video isn't stored locally, but on a remote server. Could someone here please tell me how to play a video from a remote server?

BTW, (as far as it makes any difference) I'm conding in xcode 4.

Thanks in advance.
vivendi is offline   Reply With Quote
Old 09-08-2011, 07:39 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 56
vivendi is on a distinguished road
Default

I actually just figured out what to do. But for some reason no video player is started...

Anyone any idea what i'm doing wrong??

Code:
        NSURL* videoURL = [NSURL URLWithString:@"http://www.w3schools.com/html5/movie.mp4"];
        MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
        [moviePlayer prepareToPlay];
        [moviePlayer play];
vivendi is offline   Reply With Quote
Old 09-08-2011, 07:48 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 56
vivendi is on a distinguished road
Default

It does play, but i only hear the sound in the background
How can i make it show in the videoplayer?

It looks like the video player stays behind my app... Because the toolbar at the top (where you see the battery level etc) disappears. It becomes black and then i hear the sound....

Last edited by vivendi; 09-08-2011 at 08:05 AM.
vivendi is offline   Reply With Quote
Old 09-08-2011, 08:22 AM   #4 (permalink)
Knows SQL
 
iisword's Avatar
 
Join Date: Oct 2009
Location: Somewhere the streets are on fire, the sewers are flooded, and the cats are high on catnip
Posts: 529
iisword is on a distinguished road
Default

try MPMoviePlayerViewController along with presentMoviePlayerViewControllerAnimated:
__________________
iisword is offline   Reply With Quote
Old 09-08-2011, 08:37 AM   #5 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 56
vivendi is on a distinguished road
Default

Just foind out how to do it.

I was launching the player from a webview. So i created a subview in my webview.

Code:
[self.webView addSubview:moviePlayer.view];
vivendi is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 383
8 members and 375 guests
apatsufas, JackReidy, jeroenkeij, Sami Gh, tim0504, UMAD, yomo710
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,671
Threads: 94,121
Posts: 402,904
Top Poster: BrianSlick (7,990)
Welcome to our newest member, JackReidy
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:55 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0