开发者

How to play video in iphone landscape mode?

开发者 https://www.devze.com 2023-02-28 01:46 出处:网络
I have one application in which list of videos that are coming through xml parsing are displayed in tableview. When I click particular video it should be played in landscape mode.

I have one application in which list of videos that are coming through xml parsing are displayed in tableview. When I click particular video it should be played in landscape mode. For that I followed tutorial: http://iosdevelopertips.com/video/how-to-play-movies-from-application-bundle-or-from-a-remote-server-url.html It works perfectly but it uses separate modalcontroller so when I press done button on the video or completed video is completed it returns to the that modal view and on which back button appears and when I press that back button after that I can go back to list of videos screen.but I want to go directly back to the screen which displays list of videos. for that if i write code using pushviewcontroller than application crashes.How can i solve this problem.any tutorial or sample code?

- (void) moviePlayBackDidFinish:(NSNotification*)notification 
{    
  [[UIApplication sharedApplication] setStatusBarHidden:YES];

    // Remove observer
  [[NSNotificationCenter    defaultCenter]  removeObserver:self
    name:MPMoviePlayerPlaybackDidFinishNotification 
    object:nil];

    [self dismissModalViewControllerAnimated:YES];  

    DonationVideoViewController *dvvc=[[DonationVideoViewController alloc]       initWithNibName:"DonationVideoViewController" bundle:nil];
    [self.navigationController pushViewController:dvvc animated:YES];
    }

UPDATE:I have solved the issue by using the code for calling custom开发者_如何学Pythonmovieplayercontroller in the same class where I have displayed the list of videos. So now video ends it remains to the page I want and I need to go to other page using pushviewcontroller


You should probably push dvvc in viewDidDisappear. But like Till says, we need to see the error message you are getting.

0

精彩评论

暂无评论...
验证码 换一张
取 消