Giter Site home page Giter Site logo

wzt1229 / ffmpegtest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leuangiosdev/ffmpegtest

0.0 0.0 0.0 27.03 MB

iOS支持各种视频格式播放(mp4/avi/rmvb/3gp/mov/flv/m3u8/rm)支持远程视频播放以及本地视频播放

C++ 2.27% C 89.34% Objective-C 8.28% Objective-C++ 0.11%

ffmpegtest's Introduction

##FFmpegTest ####利用 FFmpeg 做的一个视频播放的demo

  • 支持各种视频格式播放(mp4/avi/rmvb/3gp/mov/flv/m3u8/rm)支持远程视频播放以及本地视频播放
  • 图片展示

image image

###代码

   //导入头文件
   #import "KxMovieViewController.h"
   - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSString *path;
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    
    if (indexPath.section == 0) {
        if (indexPath.row >= _remoteMovies.count) return;
        path = _remoteMovies[indexPath.row];
    } else {
        if (indexPath.row >= _localMovies.count) return;
        path = _localMovies[indexPath.row];
    }

    if ([path.pathExtension isEqualToString:@"wmv"])
        parameters[KxMovieParameterMinBufferedDuration] = @(5.0);

    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
        parameters[KxMovieParameterDisableDeinterlacing] = @(YES);

    KxMovieViewController *vc = [KxMovieViewController movieViewControllerWithContentPath:path
                                                                               parameters:parameters];
    [self presentViewController:vc animated:YES completion:nil];
}

####调用简单

//path为播放文件的路径,若为本地文件就直接用文件沙盒路径
//若为网络视频,请调用视频的网络url
   KxMovieViewController *vc = [KxMovieViewController movieViewControllerWithContentPath:path
                                                                               parameters:parameters];
    [self presentViewController:vc animated:YES completion:nil];

ffmpegtest's People

Contributors

gaoyuuh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.