2012-09-26 30 views
-2

我已經給了一個網址,以播放視頻文件,我用下面的代碼在模擬器的視頻播放視頻iPhone:視頻網址使用MPMoviePlayer

NSURL *url = [NSURL URLWithString:@"http://www.hddeo.com/video/more.html"]; 
    player = [[MPMoviePlayerController alloc] initWithContentURL:url];; 

    [player setControlStyle:MPMovieControlStyleNone]; 
    player.view.frame = CGRectMake(110,375,540,250); 
    // player.view.frame = CGRectMake(50, 375, 600, 415); 
    [self.view addSubview:player.view]; 

亙古不玩 不是在玩我不知道爲什麼發生這種情況

,如果你有任何想法PLZ分享提前

感謝名單...

回答

1

,你傳遞的內容URL是它有一個HTML頁面嵌入的SWF文件。 MPMoviePlayerController需要一個直接指向視頻文件的內容URL,例如「http://www.example.com/video.mp4」。

請注意,iOS設備不支持Adobe Flash文件。

+0

所以,我不能用這個URL播放視頻我是吧? – iPhone

+0

@iPhone恐怕你不行。 – neilvillareal

+0

非常感謝 – iPhone

0
//try this code 

    NSURL *url = [NSURL URLWithString:@"http://www.hddeo.com/video/more.html"]; 
     player = [[MPMoviePlayerController alloc] initWithContentURL:url];; 

     [player setControlStyle:MPMovieControlStyleNone]; 
     player.view.frame = CGRectMake(110,375,540,250); 
     // player.view.frame = CGRectMake(50, 375, 600, 415); 
     [moviePlayer play]; 
     [self.view addSubview:player.view]; 

     // [moviePlayer prepareToPlay]; 
     // [moviePlayer play]; 
     // [moviePlayer pause];  // it preform action play pause ,stop 
     // [moviePlayer stop];