• 大小: 1014KB
    文件类型: .zip
    金币: 1
    下载: 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  ZFTPlayer-master\
     文件        1357  2018-01-15 03:05  ZFTPlayer-master\README.md
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\
     文件       61223  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.pbxproj
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.xcworkspace\
     文件         154  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.xcworkspace\contents.xcworkspacedata
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.xcworkspace\xcuserdata\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.xcworkspace\xcuserdata\zhangfangtao.xcuserdatad\
     文件        8241  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\project.xcworkspace\xcuserdata\zhangfangtao.xcuserdatad\UserInterfaceState.xcuserstate
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\xcuserdata\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\xcuserdata\zhangfangtao.xcuserdatad\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\xcuserdata\zhangfangtao.xcuserdatad\xcschemes\
     文件        3327  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\xcuserdata\zhangfangtao.xcuserdatad\xcschemes\ZFTPlayer.xcscheme
     文件         481  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer.xcodeproj\xcuserdata\zhangfangtao.xcuserdatad\xcschemes\xcschememanagement.plist
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\
     目录           0  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\
     文件       19805  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFHTTPSessionManager.h
     文件       15023  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFHTTPSessionManager.m
     文件        8068  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFNetworkReachabilityManager.h
     文件        9805  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFNetworkReachabilityManager.m
     文件        1599  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFNetworking.h
     文件        5900  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFSecurityPolicy.h
     文件       12991  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFSecurityPolicy.m
     文件       22823  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLRequestSerialization.h
     文件       51367  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLRequestSerialization.m
     文件       12238  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLResponseSerialization.h
     文件       27058  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLResponseSerialization.m
     文件       30165  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLSessionManager.h
     文件       55294  2018-01-15 03:05  ZFTPlayer-master\ZFTPlayer\3rds\AFNetworking\AFNetworking\AFURLSessionManager.m
............此处省略154个文件信息

评论

共有 条评论