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

iPhone視頻播放器 實(shí)現(xiàn)操作

移動(dòng)開(kāi)發(fā) iOS
本文介紹的是iPhone視頻播放器 實(shí)現(xiàn)操作,實(shí)現(xiàn)一個(gè)播放器的實(shí)例,我們先來(lái)看內(nèi)容。

iPhone視頻播放器 實(shí)現(xiàn)操作是本文要介紹的內(nèi)容,這篇文章是一個(gè)用iPhone播放視頻的例子,使用iPhone非官方SDK。

main.m:

  1. int main(int argc, char *argv[])  
  2. {  
  3.     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];  
  4.     int ret = UIApplicationMain(argc, argv, [SimpleMoviePlayerApp class]);  
  5.     [pool release];  
  6.     return ret;  

SimpleMoviePlayer.h:

  1. #import <UIKit/UIKit.h> 
  2. #import <GraphicsServices/GraphicsServices.h> 
  3. #import <MoviePlayerUI/UIEventObservableWindow.h> 
  4. #import <MoviePlayerUI/UIMovieView.h> 
  5. #import <MoviePlayerUI/UIMoviePlayerController.h> 
  6. @interface SimpleMoviePlayerApp : UIApplication  
  7. {  
  8.  UIEventObservableWindow *mainWindow;  
  9.  UIMoviePlayerController *playerController;  
  10. }  
  11. @end 

SimpleMoviePlayer.m

  1. #import "SimpleMoviePlayerApp.h"  
  2. @implementation SimpleMoviePlayerApp  
  3. - (void)applicationDidFinishLaunching:(GSEventRef)event;  
  4. {  
  5.  struct CGRect mainFrame = CGRectMake(0,0,320,480);  
  6.  mainWindow = [[UIEventObservableWindow alloc] initWithContentRect:mainFrame];  
  7.  playerController = [[UIMoviePlayerController alloc] initWithPlayerSize:[UIHardware mainScreenSize] isFullScreen:YES];  
  8.  [[playerController playerView] setCanShowControlsOverlay:YES];  
  9.  [playerController setControlsOverlayVisible:YES disableAutohide:NO animate: YES];  
  10.  [playerController setAutoPlayWhenLikelyToKeepUp:YES];  
  11.     [playerController setDelegate:self];  
  12.  [playerController prepareAndSetupUI];  
  13.  [[playerController movieView] setMovieWithPath:@"http://192.168.0.2/video.m4v"];  
  14.  [mainWindow setContentView:[playerController playerView]];  
  15.     [mainWindow orderFront:self];  
  16. }  
  17. - (void)moviePlayerDidFinishPlayback: (UIMoviePlayerController *)player userExited: (BOOL)userExited  
  18. {  
  19.  NSLog(@"player normal exit");  
  20.  [self terminateWithSuccess];  
  21. }  
  22.  
  23. - (void)applicationWillTerminate;  
  24. {  
  25.  NSLog(@"app normal exit");  
  26.  [playerController release];  
  27.     [mainWindow release];  
  28. }  
  29. @end 

你可以下載這個(gè)源代碼

小結(jié):iPhone視頻播放器 實(shí)現(xiàn)操作的內(nèi)容介紹完了,希望本文對(duì)你有所幫助!

原文地址(俄文):http://blog.weho.ru/2008/04/primer-prostogo-videopleera.html

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

2022-08-16 17:37:06

視頻播放器鴻蒙

2015-05-21 15:25:42

VLC播放器

2022-06-21 14:41:38

播放器適配西瓜視頻

2011-09-05 18:08:01

MTK音頻播放器

2021-10-19 14:27:07

鴻蒙HarmonyOS應(yīng)用

2021-10-21 16:00:07

鴻蒙HarmonyOS應(yīng)用

2022-11-12 08:26:04

VLC視頻播放器裁剪視頻

2011-08-09 14:42:07

iPhonePCM播放器

2011-08-10 15:58:58

iPhone視頻

2010-06-11 12:53:56

openSUSE播放器

2023-03-06 16:20:08

視頻播放器VLC

2023-03-28 09:38:34

開(kāi)發(fā)應(yīng)用鴻蒙

2023-03-28 09:44:02

開(kāi)發(fā)應(yīng)用鴻蒙

2023-03-29 09:37:49

視頻播放器應(yīng)用鴻蒙

2018-05-25 14:37:58

2011-06-13 09:33:04

2023-03-29 09:32:15

視頻播放器應(yīng)用鴻蒙

2015-09-01 16:48:44

ios暴風(fēng)視頻播放器

2023-08-26 19:07:40

VLC旋轉(zhuǎn)視頻

2012-06-04 13:44:08

點(diǎn)贊
收藏

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