Skip to content

Use KSYMediaPlayer

changsanjiang edited this page Sep 24, 2021 · 2 revisions

In this page

Reinstall

Reinstall in the following way

  source 'https://cdn.cocoapods.org/'

  pod 'SJBaseVideoPlayer/KSYMediaPlayer'
  pod 'SJVideoPlayer'
  pod 'KSYMediaPlayer_iOS/KSYMediaPlayer_vod', :git => 'https://github.com/ksvc/KSYMediaPlayer_iOS.git'

How to use

// 1. import header file
    #import <SJBaseVideoPlayer/SJKSYMediaPlayerPlaybackController.h>

    _player = SJVideoPlayer.player;
// 2. Switch playback control to SJKSYMediaPlayerPlaybackController
    _player.playbackController = SJKSYMediaPlayerPlaybackController.new;
// 3. play video
    SJVideoPlayerURLAsset *asset = [SJVideoPlayerURLAsset.alloc initWithURL:SourceURL0];
    _player.URLAsset = asset;
Clone this wiki locally