-
大小: 1014KB文件類型: .zip金幣: 2下載: 0 次發布日期: 2023-11-18
- 語言: 其他
- 標簽:
資源簡介
iOS平臺下基于IJKplayer封裝的視頻播放器

代碼片段和文件信息
//
//??AppDelegate.m
//??ZFTPlayer
//
//??Created?by?張芳濤?on?2017/5/26.
//??Copyright???2017年?張芳濤.?All?rights?reserved.
//
#import?“AppDelegate.h“
#import?“FirstViewController.h“
#import?
#import?“AFNetworkActivityIndicatorManager.h“
#import?“AFNetworking.h“
#import?
@interface?AppDelegate?()
@property(nonatomicassign)?BOOL?shouldStopBg;
@property(nonatomicstrong)AVAudioPlayer?*?audioPlayer;
@property(nonatomicassign)NSInteger?optionNumber;
@property(nonatomicassign)NSTimeInterval?interViewTime;
@end
@implementation?AppDelegate
@synthesize?allowRotation;
@synthesize?netWorkStatesCode;
#pragma?mark?-?屏幕旋轉相關設置
-(UIInterfaceOrientationMask)application:(UIApplication?*)application?supportedInterfaceOrientationsForWindow:(UIWindow?*)window
{
????if?(self.allowRotation)?{
????????return?UIInterfaceOrientationMaskAllButUpsideDown;
????}
????return?UIInterfaceOrientationMaskPortrait;
}
-?(BOOL)application:(UIApplication?*)application?didFinishLaunchingWithOptions:(NSDictionary?*)launchOptions?{
????self.window?=?[[UIWindow?alloc]initWithframe:[UIScreen?mainScreen].bounds];
????
????FirstViewController?*vc?=?[[FirstViewController?alloc]init];
????UINavigationController?*nav?=?[[UINavigationController?alloc]initWithRootViewController:vc];
????self.window.rootViewController?=?nav;
????[self.window?makeKeyAndVisible];
????[self?netWorkChangeEvent];
????[self?setUpMusicOption];
????[self?setUpMusicOptionsWithNormal:YES];
????return?YES;
}
#pragma?mark?-?檢測網絡狀態變化
-(void)netWorkChangeEvent
{
????[[AFNetworkActivityIndicatorManager?sharedManager]?setEnabled:YES];
????NSURL?*url?=?[NSURL?URLWithString:@“http://baidu.com“];
????AFHTTPSessionManager?*manager?=?[[AFHTTPSessionManager?alloc]?initWithbaseURL:url];
????[manager.reachabilityManager?setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus?status)?{
????????self.netWorkStatesCode?=?status;
????????switch?(status)?{
????????????case?AFNetworkReachabilityStatusReachableViaWWAN:
????????????????NSLog(@“當前使用的是流量模式“);
????????????????break;
????????????case?AFNetworkReachabilityStatusReachableViaWiFi:
????????????????NSLog(@“當前使用的是wifi模式“);
????????????????break;
????????????case?AFNetworkReachabilityStatusNotReachable:
????????????????NSLog(@“斷網了“);
????????????????break;
????????????case?AFNetworkReachabilityStatusUnknown:
????????????????NSLog(@“變成了未知網絡狀態“);
????????????????break;
????????????????
????????????default:
????????????????break;
????????}
????????[[NSNotificationCenter?defaultCenter]postNotificationName:@“netWorkChangeEventNotification“?object:@(status)];
????}];
????[manager.reachabilityManager?startMonitoring];
}
#pragma?mark?-??應用退到后臺或者上劃出來控制界面下劃出來通知界面都會走這個方法
-?(void)applicationWillResignActive:(UIApplication?*)application?{
????[self?setUpMusicOptionsWithNormal:YES];
????[self?performSelectorInBackground:@selector(playEmptyMusicInBackGround)?withobject:nil];
????[[NSNotificationCenter?defaultCenter]postNotificationName:@“applicat
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件????????1357??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件???????61223??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件?????????154??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件????????8241??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件????????3327??2018-01-15?03:05??ZFTPla
?????文件?????????481??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????目錄???????????0??2018-01-15?03:05??ZFTPla
?????文件???????19805??2018-01-15?03:05??ZFTPla
?????文件???????15023??2018-01-15?03:05??ZFTPla
?????文件????????8068??2018-01-15?03:05??ZFTPla
?????文件????????9805??2018-01-15?03:05??ZFTPla
?????文件????????1599??2018-01-15?03:05??ZFTPla
?????文件????????5900??2018-01-15?03:05??ZFTPla
?????文件???????12991??2018-01-15?03:05??ZFTPla
?????文件???????22823??2018-01-15?03:05??ZFTPla
?????文件???????51367??2018-01-15?03:05??ZFTPla
?????文件???????12238??2018-01-15?03:05??ZFTPla
?????文件???????27058??2018-01-15?03:05??ZFTPla
?????文件???????30165??2018-01-15?03:05??ZFTPla
?????文件???????55294??2018-01-15?03:05??ZFTPla
............此處省略154個文件信息
評論
共有 條評論