自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

iPhone應(yīng)用中使用MPMoviePlayerController視頻播放

移動開發(fā) iOS
iPhone應(yīng)用中使用MPMoviePlayerController視頻播放是本文要介紹的內(nèi)容,內(nèi)容不多,主要是基于代碼來實現(xiàn)如何使用MPMoviePlayerController視頻播放的內(nèi)容,具體內(nèi)容來看本文詳解,

iPhone應(yīng)用中使用MPMoviePlayerController視頻播放是本文要介紹的內(nèi)容,內(nèi)容不多,主要是基于代碼來實現(xiàn)如何使用MPMoviePlayerController視頻播放的內(nèi)容,具體內(nèi)容來看本文詳解,

 

  1.  -(void)openMovie:(id)sender    
  2. {    
  3. NSString *path = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"m4v"];    
  4. MPMoviePlayerController *movieController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:path]]; 
  5. //設(shè)置要播放的視頻的位置    
  6.  
  7.  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(movieFinish:) name:
  8. MPMoviePlayerPlaybackDidFinishNotification object:movieController]; //設(shè)置視頻播放結(jié)束后的回調(diào)處理     
  9.     [movieController play]; //視頻播放    
  10. }  
  1. -(void)movieFinish:(NSNotification*)notification    
  2.     
  3.   MPMoviePlayerController *movieController = [notification object];    
  4.    [[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackDidFinishNotification object:movieController];    
  5.    [movieController release]; //釋放資源    
  6.     movieController = nil;    
  7.    [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:YES];    
  8.   

小結(jié):iPhone應(yīng)用中使用MPMoviePlayerController視頻播放的內(nèi)容介紹完了,希望通過本文的學習能對你有所幫助!

責任編輯:zhaolei 來源: 互聯(lián)網(wǎng)
相關(guān)推薦

2011-08-02 16:58:15

iPhone AVAudioPla 音頻播放

2011-08-10 15:58:58

iPhone視頻

2011-08-11 13:26:30

iPhoneNSLocalized

2011-07-20 16:21:20

iPhone 視頻 播放器

2011-07-27 09:50:31

iPhone AVAudioPla 音頻

2011-08-08 18:19:09

iPhone音頻播放

2011-07-08 20:32:57

iPhone midi

2024-03-14 08:24:25

MediaCodec解碼播放Android

2011-08-18 13:58:34

iPhone開發(fā)NSOperation異步

2011-08-15 15:26:20

iPhone開發(fā)CocoaXML

2011-05-18 15:50:26

UI設(shè)計iPhoneiOS

2013-07-01 10:53:05

2009-02-24 11:05:07

ibmdwiphonegoogle

2011-07-20 14:53:28

iPhone NSLocalize 國際化

2011-08-08 10:42:46

iPhone UITableVie 分頁

2011-09-15 17:29:36

iPhone應(yīng)用Netrobe

2011-08-17 13:27:08

iPhone游戲開發(fā)objective-c

2011-08-09 14:42:07

iPhonePCM播放器

2011-08-09 11:36:41

iPhoneUIPickerVieDEMO

2011-07-29 11:10:56

IOS SimpleLogg 日志
點贊
收藏

51CTO技術(shù)棧公眾號