TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Jan 2016 |
Maintained by Denis Zamataev.
iOS Video Player control, implemented with AVPlayer.
iOS Video Player control that features
This pod contains an Example project showing how to play local file and implement fullscreen expand and shrink transitioning.
You can find more example usage of this control here at OhMyTube github page.
Basic snippet to start with:
self.videoPlayerViewController.delegate = self;
self.videoPlayerViewController.videoURL = [NSURL URLWithString:@"http://distilleryvesper7-3.ak.instagram.com/fdc51d8ea73611e3a15612e740d32ce3_101.mp4"];
self.videoPlayerViewController.isBackgroundPlaybackEnabled = YES;
[self.videoPlayerViewController prepareAndPlayAutomatically:YES];
Implement DZVideoPlayerViewControllerDelegate
#pragma mark - <DZVideoPlayerViewControllerDelegate>
- (void)playerFailedToLoadAssetWithError:(NSError *)error {
}
- (void)playerDidPlay {
}
- (void)playerDidPause {
}
- (void)playerDidStop {
}
- (void)playerDidToggleFullscreen {
if (self.videoPlayerViewController.isFullscreen) {
// TODO: implement expand videoPlayerViewController to fullscreen
}
else {
// TODO: implement shrink videoPlayerViewController from fullscreen
}
}
- (void)playerDidPlayToEndTime {
}
- (void)playerFailedToPlayToEndTime {
}
- (void)playerPlaybackStalled {
}
- (void)playerGatherNowPlayingInfo:(NSMutableDictionary *)nowPlayingInfo {
// [nowPlayingInfo setObject:self.video.author forKey:MPMediaItemPropertyArtist];
[nowPlayingInfo setObject:self.video.title forKey:MPMediaItemPropertyTitle];
}
Version 0.2.* and above runs on iOS 8.0 and later. Version 0.1.* runs on iOS 7.0 and later.
There are at least 3 ways to customize this control.
DZVideoPlayerViewController.xib
). No need to hook actions, because they will be added programmatically in the DZVideoPlayerViewController
class.DZVideoPlayerViewController
and provide your overrides for different methods.playButton
and pauseButton
, change tint color on progressIndicator
, hide fullscreenExpandButton
and fullscreenShrinkButton
if you don't want that feature.Feel free to provide Pull Requests with custom XIBs you create. Good luck!
DZVideoPlayerViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "DZVideoPlayerViewController"
Denis Zamataev, [email protected]
DZVideoPlayerViewController is available under the MIT license. See the LICENSE file for more info.