Latest 1.0.3
Homepage https://github.com/90candy/YWVideoPlayer
License Apache-2.0
Platforms ios 8.0, requires ARC
Dependencies SDWebImage
Frameworks UIKit, Foundation, MediaPlayer, CoreAudio, AudioToolbox, Accelerate, QuartzCore, OpenGLES, AVFoundation, CoreVideo, AVKit, CoreMedia, VideoToolbox, CoreTelephony
Authors

Pod
Platform
License
Author

全屏模式 – 效果图

YWVideoPlayer

基于ijkPlayer的网络播放器,支持HTTP、RTMP、HLS(m3u8)、本地视频等多种格式

3分钟快速集成播放器,支持小屏、全屏模式,无需手动添加任何依赖库

一、推荐使用CocoaPods方式集成

1、在podfile文件中添加,然后执行 pod install操作,文件较大,请耐心等待

pod 'YWVideoPlayer', '~> 1.0.3'

2、AppDelegate.h 文件中加入 fullScreen 属性,如下

#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (nonatomic) BOOL fullScreen;

@end

3、在 AppDelegate.m 文件中 加入横屏方法(无需调用)

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
    if (self.fullScreen == YES) {
        return UIInterfaceOrientationMaskAll;
    }
    return UIInterfaceOrientationMaskPortrait;
}

4、在播放器控制器界面导入头文件
Demo 里面是在BasePlayerViewController中引入相关头文件

#import "YWMediaPlayerView.h"

5、照着BasePlayerViewController文件中的方式去使用即可

// 这里的SecondViewController是继承了BasePlayerViewController
#import "SecondViewController.h"
@interface SecondViewController ()
@end
@implementation SecondViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];

    self.isLiveVideo = YES;
    [self.view addSubview:self.playerView];

    // 测试链接 http、rtmp、m3u8
    // NSString *testUrl = @"http://flv2.bn.netease.com/videolib3/1604/28/fVobI0704/SD/fVobI0704-mobile.mp4";
    // NSString *testUrl = @"rtmp://live.hkstv.hk.lxdns.com/live/hks";
    NSString *testUrl = @"http://dlhls.cdn.zhanqi.tv/zqlive/49427_jmACJ.m3u8";
    [self showPlayerViewWithUrl:testUrl Title:@"视频的标题"];
    // 自动播放
    [self autoPlay];
}

@end

二、手动拖拽到项目方式

完善中


简书地址:https://www.jianshu.com/p/546df1c8a3fc

图片名称

Latest podspec

{
    "name": "YWVideoPlayer",
    "version": "1.0.3",
    "summary": "u57fau4e8eijkplayeru7684u64adu653eu5668,u652fu6301HTTPu3001RMTPu3001HLS(m3u8)u3001u672cu5730u89c6u9891u7b49u7b49",
    "description": "u57fau4e8eijkplayeru7684u64adu653eu5668,u53efu64adRMTPu3001u7f51u7edcu89c6u9891u3001u672cu5730u89c6u9891u7b49u7b49"",
    "homepage": "https://github.com/90candy/YWVideoPlayer",
    "license": {
        "type": "Apache-2.0",
        "file": "LICENSE"
    },
    "authors": {
        "u963fu552fu4e0du77e5u9053": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/90candy/YWVideoPlayer.git",
        "tag": "1.0.3"
    },
    "source_files": "YWVideoPlayerDemo/YWVideoPlayer/*.{h,m}",
    "resources": "YWVideoPlayerDemo/YWVideoPlayer/Resources/*.png",
    "requires_arc": true,
    "dependencies": {
        "SDWebImage": [
            ">=4.0.0"
        ]
    },
    "social_media_url": "https://www.jianshu.com/u/0f7d26d766f4",
    "vendored_frameworks": "YWVideoPlayerDemo/IJKMediaFramework.framework",
    "libraries": [
        "c++",
        "z",
        "bz2"
    ],
    "frameworks": [
        "UIKit",
        "Foundation",
        "MediaPlayer",
        "CoreAudio",
        "AudioToolbox",
        "Accelerate",
        "QuartzCore",
        "OpenGLES",
        "AVFoundation",
        "CoreVideo",
        "AVKit",
        "CoreMedia",
        "VideoToolbox",
        "CoreTelephony"
    ]
}

Pin It on Pinterest

Share This