All Projects → josejuanqm → Versaplayer

josejuanqm / Versaplayer

Licence: mit
Versatile Video Player implementation for iOS, macOS, and tvOS

Programming Languages

swift
15916 projects
swift4
162 projects

Projects that are alternatives of or similar to Versaplayer

Ezplayer
基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定制性强,支持react-native。
Stars: ✭ 377 (-37.99%)
Mutual labels:  avplayer, airplay, pip
React Native Ezplayer
EZPlayer component for react-native apps
Stars: ✭ 47 (-92.27%)
Mutual labels:  avplayer, airplay, pip
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 (+185.53%)
Mutual labels:  video-player, avplayer
Sjvideoplayer
iOS VideoPlayer MediaPlayer video player media player 短视频播放器 可接入 ijkplayer aliplayer alivodplayer plplayer
Stars: ✭ 2,066 (+239.8%)
Mutual labels:  video-player, avplayer
Laravel Google Ads
Google Ads API for Laravel
Stars: ✭ 56 (-90.79%)
Mutual labels:  ads, google
Avplayeroverlay
AVPlayer with custom controls, full screen mode, subtitles (.srt), Picture-In-Picture and AirPlay features.
Stars: ✭ 59 (-90.3%)
Mutual labels:  video-player, avplayer
Abmediaview
Media view which subclasses UIImageView, and can display & load images, videos, GIFs, and audio and from the web, and has functionality to minimize from fullscreen, as well as show GIF previews for videos.
Stars: ✭ 79 (-87.01%)
Mutual labels:  video-player, avplayer
Skip Ad
A simple lightweight Chrome extension that automatically skips YouTube Ads.
Stars: ✭ 54 (-91.12%)
Mutual labels:  ads, google
Gindex V4
A Vue Js Based G Index with Improved Dark Mode, Search and Video Player
Stars: ✭ 143 (-76.48%)
Mutual labels:  google, video-player
vlitejs
🦋 vLitejs is a fast and lightweight Javascript library for customizing video and audio player in Javascript with a minimalist theme (HTML5, Youtube, Vimeo, Dailymotion)
Stars: ✭ 162 (-73.36%)
Mutual labels:  ads, airplay
AVPlayer-SwiftUI
Using AVPlayer in SwiftUI
Stars: ✭ 204 (-66.45%)
Mutual labels:  video-player, avplayer
Mobileplayer Ios
📱 🎥 A powerful and completely customizable media player for iOS
Stars: ✭ 2,931 (+382.07%)
Mutual labels:  ads, video-player
Kjplayerdemo
视频播放壳子:动态切换内核,支持边下边播边缓存的播放器方案,视频支持格式:mp4、m3u8、wav、avi,音频支持格式:midi、mp3
Stars: ✭ 60 (-90.13%)
Mutual labels:  video-player, avplayer
Arplayer
Playback videos using ARKit and AVFoundation.
Stars: ✭ 117 (-80.76%)
Mutual labels:  video-player, avplayer
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (-97.37%)
Mutual labels:  extensions, ads
Pext
Python-based extendable tool
Stars: ✭ 380 (-37.5%)
Mutual labels:  extensions, extensible
Vgplayer
📺 A simple iOS video player by Vein.
Stars: ✭ 383 (-37.01%)
Mutual labels:  video-player, avplayer
Geocoder
Geocode addresses to coordinates
Stars: ✭ 566 (-6.91%)
Mutual labels:  google
Try
Dead simple CLI tool to try Python packages - It's never been easier! 📦
Stars: ✭ 588 (-3.29%)
Mutual labels:  pip
Google Map React
Google map library for react that allows rendering components as markers 🎉
Stars: ✭ 5,529 (+809.38%)
Mutual labels:  google

CI Status Version License Platform

News

🎉 - Since 2.1.3 VersaPlayer now supports iOS, macOS, and tvOS

Community

If you have any doubts or need help with anything, head over to Gitter and ask it there!

Example

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

IMPORTANT: If you do not have an Apple ID with a developer account for code signing apps, the build will fail with a code signing error. To work around this, you can delete the "Code Signing Identity" build setting of the "Application" target to work around the issue.

Alternatively, if you do have a developer account, you can create the file "Examples/Xcode-config/DEVELOPMENT_TEAM.xcconfig" with the following build setting as its content:

DEVELOPMENT_TEAM = [Your TeamID]

For a more detailed description of this, you can have a look at the comments at the end of the file "Examples/Xcode-config/Base.xcconfig".

Installation

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

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

pod 'VersaPlayer'

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate Alamofire into your Xcode project using Carthage, specify it in your Cartfile:

github "josejuanqm/VersaPlayer" "3.0.0"

Usage

Basic Usage

VersaPlayer aims to be simple to use but also flexible, to start using VersaPlayer first create a view programatically or via storyboard. Then add this few lines of code to start playing your video.

    @IBOutlet weak var playerView: VersaPlayerView!

    override func viewDidLoad() {
        super.viewDidLoad()
        if let url = URL.init(string: "http://rmcdn.2mdn.net/Demo/html5/output.mp4") {
            let item = VersaPlayerItem(url: url)
            playerView.set(item: item)
        }
    }

Adding Controls

To add controls for your player use the VersaPlayerControls class, which comes packed with outlets to control your player, you can also add as many as you like by making a custom implementation.

VersaPlayerControls class include the following outlets:

Outlet Name Type Action
playPauseButton VersaStatefullButton Toggle playback
fullscreenButton VersaStatefullButton Toggle fullscreen mode
pipButton VersaStatefullButton Toggle PIP mode in supported devices
rewindButton VersaStatefullButton Rewind playback
forwardButton VersaStatefullButton Fast forward playback
skipForwardButton VersaStatefullButton Skip forward the time specified in second at skipSize (found in VersaPlayerControls)
skipBackwardButton VersaStatefullButton Skip backward the time specified in second at skipSize (found in VersaPlayerControls)
seekbarSlider VersaSeekbarSlider Seek through playback
currentTimeLabel VersaTimeLabel Indicate the current time
totalTimeLabel VersaTimeLabel Indicate the total time
bufferingView UIView Shown when player is buffering
    @IBOutlet weak var playerView: VersaPlayerView!
    @IBOutlet weak var controls: VersaPlayerControls!

    override func viewDidLoad() {
        super.viewDidLoad()
        playerView.use(controls: controls)
        if let url = URL.init(string: "http://rmcdn.2mdn.net/Demo/html5/output.mp4") {
            let item = VersaPlayerItem(url: url)
            playerView.set(item: item)
        }
    }

Advanced Usage

DRM

VersaPlayer also brings support for encrypted content, to make use of this functionality you must implement VersaPlayerDecryptionDelegate and assign it to VersaPlayer's decryptionDelegate property.

To read more about this topic go to:

https://josejuanqm.github.io/Libraries-Documentation/VersaPlayerCore/Protocols/VersaPlayerDecryptionDelegate.html

Tracks

To make use of different media tracks, such as audio, video, or captioning, use VersaPlayerMediaTracks, found in VersaPlayer class.

to learn more about this properties go to:

https://josejuanqm.github.io/Libraries-Documentation/VersaPlayerCore/Classes/VersaPlayerMediaTrack.html

Audio Tracks

Audio tracks are specially helpfull when dealing with different languages, for example for a movie playback.

To select an audio track simply fetch available tracks with VersaPlayer's audioTracks property.

    @IBOutlet weak var playerView: VersaPlayer!

    ...
    
    let tracks: [VersaPlayerMediaTrack] = playerView.player.currentItem?.audioTracks
    /// the name of the track
    let name = tracks.first?.name
    /// the language of the track
    let name = tracks.first?.language
    /// selecting the first one
    tracks.first?.select(for: playerView.player)
Video Tracks

Video tracks are most helpfull when dealing with different renditions or different streams per video quality.

To select an video track simply follow the same principles as an audio track.

    @IBOutlet weak var playerView: VersaPlayer!

    ...
    
    let tracks: [VersaPlayerMediaTrack] = playerView.player.currentItem?.videoTracks
    /// the name of the track
    let name = tracks.first?.name
    /// selecting the first one
    tracks.first?.select(for: playerView.player)
Caption Tracks

Caption tracks are almost always helpfull. This can be used from a movie playback all the way to assitive content.

To select an video track simply follow the same principles as video and audio tracks.

    @IBOutlet weak var playerView: VersaPlayer!

    ...
    
    let tracks: [VersaPlayerMediaTrack] = playerView.player.currentItem?.captionTracks
    /// the name of the track
    let name = tracks.first?.name
    /// the language of the track
    let name = tracks.first?.language
    /// selecting the first one
    tracks.first?.select(for: playerView.player)
Caption Styling

Caption styling are not usually managed by the user, but when necessary, captionStyling property from VersaPlayer comes in handy.

Explore all the available attributes that can be changed here:

https://josejuanqm.github.io/Libraries-Documentation/VersaPlayerCore/Classes/VersaPlayerCaptionStyling.html

Extensions

Versa is aimed to be versatile, and that's why it comes with an extensions feature, that lets you customize any aspect of the player by inheriting from VersaPlayerExtension.

This class comes with a player attribute that points to the player instance from which is being used. To add an extension use the add(extension ext:) method found in https://josejuanqm.github.io/Libraries-Documentation/VersaPlayerCore/Classes/VersaPlayer.html.

Here are some extensions for VersaPlayer that may be useful for you.

  1. AirPlay Extension

  2. Ads Extension

  3. Overlay Content Extension

Documentation

Full documentation avilable https://josejuanqm.github.io/Libraries-Documentation/VersaPlayerCore/

Author

Jose Quintero - [email protected]

Contributors

People that make VersaPlayer possible, Thank you!

josejuanqm pbeast danibachar HuseyinVural

Donation

If you like this project or has been helpful to you, you can buy me a cup of coffe :) Appreciate it!

paypal

License

VersaPlayer 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].