GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ShelinShelin/XLVideoPlayer: 基于AVFoundation的播放器

BranchesTags
Open more actions menu

Latest commit

 

History

78 Commits
78 Commits

Folders and files

NameName
Last commit message
Last commit date
Pods
Pods
 
 
XLVideoPlayer.xcodeproj
XLVideoPlayer.xcodeproj
 
 
XLVideoPlayer.xcworkspace
XLVideoPlayer.xcworkspace
 
 
XLVideoPlayer
XLVideoPlayer
 
 
XLVideoPlayerTests
XLVideoPlayerTests
 
 
XLVideoPlayerUITests
XLVideoPlayerUITests
 
 
gif
gif
 
 
Podfile
Podfile
 
 
Podfile.lock
Podfile.lock
 
 
README.md
README.md
 
 

Repository files navigation

XLVideoPlayer

A Custom Video Player

  • XLVideoPlayer.h接口定义

/**
 *  video url 视频路径
 */
@property (nonatomic, strong) NSString *videoUrl;

/**
 *  play or pause
 */
- (void)playPause;

/**
 *  dealloc 销毁
 */
- (void)destroyPlayer;

/**
 *  在cell上播放必须绑定TableView、当前播放cell的IndexPath
 */
- (void)playerBindTableView:(UITableView *)bindTableView currentIndexPath:(NSIndexPath *)currentIndexPath;

/**
 *  在scrollview的scrollViewDidScroll代理中调用
 *
 *  @param support        是否支持右下角小窗悬停播放
 */
- (void)playerScrollIsSupportSmallWindowPlay:(BOOL)support;

  • 使用
@interface VideoDetailViewController () {
    XLVideoPlayer *_player;
}
@end
@implementation VideoDetailViewController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    _player = [[XLVideoPlayer alloc] init];
    _player.videoUrl = self.mp4_url;
    [_player playerBindTableView:self.exampleTableView currentIndexPath:_indexPath];
    _player.frame = CGRectMake(0, 64, self.view.frame.size.width, 250);
    [cell.contentView addSubview:_player];
}

#pragma mark - UIScrollViewDelegate

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    if ([scrollView isEqual:self.exampleTableView]) {
        
        [_player playerScrollIsSupportSmallWindowPlay:YES];
    }
}

About

基于AVFoundation的播放器

Resources

Readme
Activity

Stars

291 stars

Watchers

9 watching

Forks

64 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.