美文网首页
AVFoundation播放视频

AVFoundation播放视频

作者: e85a0a8a9ba4 | 来源:发表于2016-07-09 16:17 被阅读27次
//1. 获取URL地址
    NSURL *url = [[NSBundle mainBundle] URLForResource:@"Cupid_高清.mp4" withExtension:nil];
    
    //2. AV播放视图控制器
    AVPlayerViewController *pVC = [AVPlayerViewController new];
    
    //3. 创建player --> 设置时需要传入网址
    pVC.player = [AVPlayer playerWithURL:url];
    
    //4. 开始播放
    [pVC.player play];
    
    //5. 模态弹出
    [self presentViewController:pVC animated:YES completion:nil];
    
    //5. 如果想要自定义播放器的大小,应该自定义 --> 设置frame / 添加到视图中
    pVC.view.frame = CGRectMake(40, 200, 300, 400);
    [self.view addSubview:pVC.view];

相关文章

  • AVFoundation播放视频

  • AVFoundation:视频播放

    视频播放所设计到的类 1、AVPlayerAVPlayer用来播放基于时间的视听媒体的控制器对象。支持播放从本地、...

  • iOS中的视频播放

    播放视频,咱们首先用AVFoundation进行开发 需要先添加库 AVFoundation.framework ...

  • AVFoundation Programming Guide(学

    介绍使用Assets播放编辑静态视频捕获输出时间和媒体表现 关于AVFoundation AVFoundation...

  • AVFoundation 简介

    AVFoundation能做什么 AVFoundation 提供了 iOS 基本的音视频处理,包括播放,采集,编辑...

  • ios系统框架

    3.AVFoundation AVFoundation提供先进的视频播放和记录能力。在需要对视频呈现和记录有更多的...

  • AVFoundation-视频播放

    1. 播放视频综述 AVFoundation 对于播放封装了主要的三个类 AVPlay、AVPlayerLayer...

  • AVFoundation之视频播放

    1. AVPlayer AVPlayer 是一个用来播放基于时间的视听媒体的控制器对象(一个队播放和资源时间相隔信...

  • iOS - AVFoundation - 视频播放

    在iOS9之前,视频播放使用MPMoviePlayerController来实现。在iOS9之后,MPMovieP...

  • 四、iOS 视频播放

    视频播放 一般在iOS开发中,视频播放主要是用MediaPlayer和AVFoundation框架实现。本集合主要...

网友评论

      本文标题:AVFoundation播放视频

      本文链接:https://www.haomeiwen.com/subject/bxorjttx.html