All Projects → mwaqasbhati → MBVideoPlayer

mwaqasbhati / MBVideoPlayer

Licence: MIT License
A video player on top of AVQueuePlayer with custom header, playlist items, play, pause, seek to slider, time, resize to fullscreen, forward, backward horizontal, vertical capabilities.

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to MBVideoPlayer

Sjvideoplayer
iOS VideoPlayer MediaPlayer video player media player 短视频播放器 可接入 ijkplayer aliplayer alivodplayer plplayer
Stars: ✭ 2,066 (+1905.83%)
Mutual labels:  avplayer, videoplayer
AutoVideoPlayer
Easily Play/Pause videos in any UIView subclass especially UITableViewCell subclass
Stars: ✭ 88 (-14.56%)
Mutual labels:  avplayer, videoplayer
audioStreamDemo
A music player created in swift using AVPlayer to stream audio from server.
Stars: ✭ 33 (-67.96%)
Mutual labels:  avplayer, swift5
Bmplayer
A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
Stars: ✭ 1,736 (+1585.44%)
Mutual labels:  avplayer, swift5
Videoplayer
📽 A video player for SwiftUI, support for caching, preload and custom control view. SwiftUI 视频播放器,支持边下边播、预加载、自定义控制层
Stars: ✭ 212 (+105.83%)
Mutual labels:  avplayer, videoplayer
KiwiPlayer
Kiwi Player allows you go forward and go back in videos easily! 💃
Stars: ✭ 18 (-82.52%)
Mutual labels:  avplayer, avqueueplayer
m3u8ToMP4
iOS demo,avplayer play m3u8 .ts file
Stars: ✭ 22 (-78.64%)
Mutual labels:  avplayer, swift5
MIDIKit
🎹 Modern multi-platform Swift CoreMIDI wrapper with MIDI 2.0 support.
Stars: ✭ 26 (-74.76%)
Mutual labels:  swift5
Extras
Just some extras..
Stars: ✭ 17 (-83.5%)
Mutual labels:  swift5
iphonepip
PiP (Picture in Picture) prototype for iPhone
Stars: ✭ 15 (-85.44%)
Mutual labels:  avplayer
Shift
Light-weight EventKit wrapper.
Stars: ✭ 31 (-69.9%)
Mutual labels:  swift5
OnlySwitch
⚙️ All-in-One menu bar app, hide 💻MacBook Pro's notch, dark mode, AirPods, Shortcuts
Stars: ✭ 1,288 (+1150.49%)
Mutual labels:  swift5
ACarousel
A carousel view for SwiftUI | SwiftUI 旋转木马效果
Stars: ✭ 124 (+20.39%)
Mutual labels:  swift5
Logo
Logo Tiger Enterprise Özel Raporlar, Tablo ve View Açıklamaları
Stars: ✭ 73 (-29.13%)
Mutual labels:  custom
SwiftBrick
swift砖块系列:UI基础框架,有各种工具方便快速搭建APP
Stars: ✭ 19 (-81.55%)
Mutual labels:  swift5
Podcasts-UIKit
OUTDATED. A clone of Apple's Podcasts. UIKit version.
Stars: ✭ 145 (+40.78%)
Mutual labels:  avplayer
Swipeable-View
Simple editActionsForRowAt functionality, written on SWIFTUI
Stars: ✭ 37 (-64.08%)
Mutual labels:  swift5
Swift101
That contains various information and examples about the basics of Swift Programming. 💻 📱 📺 ⌚️
Stars: ✭ 28 (-72.82%)
Mutual labels:  swift5
Setup-Xcode-Derived-Data-RAM-Disk
Swift Script: Get the fastest build times in Xcode. This repository accompanies my article linked here:
Stars: ✭ 118 (+14.56%)
Mutual labels:  swift5
NYTimes-iOS
🗽 NY Times is an Minimal News 🗞 iOS app 📱 built to describe the use of SwiftSoup and CoreData with SwiftUI🔥
Stars: ✭ 152 (+47.57%)
Mutual labels:  swift5

MBVideoPlayer

A video player on top of AVQueuePlayer with custom header, playlist items, play, pause, seek to slider, time, resize to fullscreen, forward, backward horizontal, vertical capabilities.

Portrait Portrait Full Screen Landscape Full Screen
Demo Demo Demo

Contents

Features

  • Support Both Horizontal and Vertical Orientation.
  • Custom Header view which in configurable.
  • Custom Theme which will control your player colors, fonts etc.
  • Custom Configuration which will control player settings.
  • Can be embedded within a view or be presented in full screen.
  • option to add custom playlist with title and thumbnail.
  • Include play, pause, forward, backward, fullscreen, timer and playlist functionalities.

Requirements

  • iOS 13.0
  • Swift 5.0

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Manually

CocoaPods

MBVideoPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MBVideoPlayer', :git => 'https://github.com/mwaqasbhati/MBVideoPlayer.git'

Usage

We can initialize it via Storyboard as well as from the code.

Using StoryBoard

First of all assign class MBVideoPlayer to UIView in Storyboard and then make an out of it. @IBOutlet weak var videoPlayerView: MBVideoPlayerView! then create playlist using below code.

Using Code

let playerView = MBVideoPlayerView(configuration: nil, theme: nil, header: nil)

        let playerItems = [
            PlayerItem(title: "Apple Live Broadcast WWDC.", url: "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8", thumbnail: "1"),
            PlayerItem(title: "Driving a Cycle experience.", url: "https://content.jwplatform.com/manifests/yp34SRmf.m3u8", thumbnail: "2"),
            PlayerItem(title: "The Durian Open Movie Project.", url: "https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8", thumbnail: "3"),
            PlayerItem(title: "Table Ronde.", url: "https://mnmedias.api.telequebec.tv/m3u8/29880.m3u8", thumbnail: "4"),
            PlayerItem(title: "What is this event? ... parker.", url: "https://bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8", thumbnail: "5")
        ]
        
        if let currentItem = playerItems.first {
            videoPlayerView.setPlayList(currentItem: currentItem, items: playerItems, fullScreenView: view)
        }
                
        view.addSubview(playerView)
        playerView.pinEdges(to: view)

Custom CallBacks

protocol MBVideoPlayerViewDelegate: class {
    var playerStateDidChange: ((MBVideoPlayerState)->())? {get set}
    var playerTimeDidChange: ((TimeInterval, TimeInterval)->())? {get set}
    var playerOrientationDidChange: ((PlayerDimension) -> ())? {get set}
    var playerDidChangeSize: ((PlayerDimension) -> ())? {get set}
    var playerCellForItem: (()->(UICollectionViewCell))? {get set}
    var playerDidSelectItem: ((IndexPath)->())? {get set}
}

Custom Configuration

public protocol MBConfiguration {
    var canShowVideoList: Bool { get }
    var canShowTime: Bool { get }
    var canShowPlayPause: Bool { get }
    var canShowTimeBar: Bool { get }
    var canShowFullScreenBtn: Bool { get }
    var canShowForwardBack: Bool { get }
    var canShowHeader: Bool { get }
    var canShowHeaderTitle: Bool { get }
    var canShowHeaderOption: Bool { get }
    var dimension: PlayerDimension { get }
    var seekDuration: Float64 { get }
}

Custom Theme

public protocol MBTheme {
    var buttonTintColor: UIColor { get }
    var headerBackgroundColor: UIColor { get }
    var headerBackgroundOpacity: Float { get }
    var playListCurrentItemTextColor: UIColor { get }
    var playListItemsTextColor: UIColor { get }
    var playListCurrentItemFont: UIFont { get }
    var playListItemsFont: UIFont { get }
    var timeLabelTextColor: UIColor { get }
    var sliderTintColor: UIColor { get }
    var sliderThumbColor: UIColor { get }
    var activityViewColor: UIColor { get }
    var playListItemsBackgroundColor: UIColor { get }
    
    var resizeButtonImage: UIImage! { get }
    var playButtonImage: UIImage! { get }
    var pauseButtonImage: UIImage! { get }
    var forwardButtonImage: UIImage! { get }
    var backButtonImage: UIImage! { get }
    var optionsButtonImage: UIImage! { get }
}

Demo

Contact

Email: [email protected]

Blog: https://medium.com/@wqsbhtt/mbvideoplayer-2ec2bf292574

Contribution

1- Fork it!

2- Create your feature branch: git checkout -b my-new-feature

3- Commit your changes: git commit -am 'Add some feature'

4- Push to the branch: git push origin my-new-feature

5- Submit a pull request

License

MBVideoPlayer is available under the MIT license. See the LICENSE file for more info.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].