All Projects → mukeshydv → Youtubeplayerview

mukeshydv / Youtubeplayerview

Licence: mit
Helper library for iOS developers that want to embed YouTube videos in their iOS apps with the iframe player API. 📹

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Youtubeplayerview

Youtube Extension
🔴YouTube Extension🧰>80 Features ⭐Please document, code or donate📌Tidy📌Longest-standing(2012)(Users>350000)⋮🎞️🎛️🎧⚙️🎬🔊☕🎨🧩🧪📈⏯️(Player: Repeat Screenshot Rotate; Hide related video distraction. Always expand video Description. Playback speed. Video Quality bandwidth H.264 electricity. Player Size Full Window. Themes Customization. Statistics. Reverse Playlist YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube YouTube Youtube enhancer YouTube app YouTube video YouTube YouTube YouTube api v3 YouTube playback YouTube player VP8 VP9 AV1 vidIQ tubebuddy download adblocker adblock ads sponsorblock addon youtube music ⭐ youtube premium css css4 html5 ytdl youtube-dl invidious iridium ParticleCore youtube+ youtube++ youtube-plus maia-yt youtube nonstop youtube control center vlogger vlog h264ify h264 m.youtube.com music.youtube.com studio.youtube youtube mobile youtube studio ⭐ kids Vanced gaming.youtube.com gaming youtubecenter freetube lite-youtube-embed newpipe youtube-dl-gui mps-youtube nuclear pytube awesome youtubers youtube downloader 8k 4k 60fps 30fps youtubeexplode vidgear k-lite tubebuddy adobe apple ios iphone design simplify ffmpeg premiere designer annoyance youtube upload
Stars: ✭ 1,027 (+1326.39%)
Mutual labels:  youtube-api, youtube-player
Android Youtube Background Player
YouTube background player
Stars: ✭ 144 (+100%)
Mutual labels:  youtube-api, youtube-player
Jquery.mb.ytplayer
use a custom yutube player for a video as background on jQuery framework
Stars: ✭ 1,199 (+1565.28%)
Mutual labels:  youtube-api, youtube-player
Channels
The Mac App for YouTube Channels.
Stars: ✭ 23 (-68.06%)
Mutual labels:  youtube-api, youtube-player
Rey
RE-imagined Youtube music player for web (& desktop)
Stars: ✭ 59 (-18.06%)
Mutual labels:  youtube-api, youtube-player
React Native Youtube Iframe
A wrapper of the Youtube-iframe API built for react native.
Stars: ✭ 221 (+206.94%)
Mutual labels:  youtube-api, youtube-player
Ngx Youtube Player
YouTube player app built with Angular 7
Stars: ✭ 92 (+27.78%)
Mutual labels:  youtube-api, youtube-player
Yt Player
Simple, robust, blazing-fast YouTube Player API
Stars: ✭ 576 (+700%)
Mutual labels:  youtube-api, youtube-player
angular-youtube-player
Simple youtube player created with angular and typescript. See demo.
Stars: ✭ 35 (-51.39%)
Mutual labels:  youtube-api, youtube-player
search-youtube
An Android App used for searching and playing videos from YouTube. Used: Youtube Data API v3, YouTube Player API
Stars: ✭ 24 (-66.67%)
Mutual labels:  youtube-api, youtube-player
ytqck.github.io
YouTube quick ⚡ Search and Download Music for Free.
Stars: ✭ 18 (-75%)
Mutual labels:  youtube-api, youtube-player
Youtubedownloader
Android App for searching for videos on Youtube by keywords using YouTube Data API and download videos from YouTube in different formats.
Stars: ✭ 25 (-65.28%)
Mutual labels:  youtube-api, youtube-player
Streamingclientlibrary
C# client library for Twitch, YouTube Live, and other streaming services
Stars: ✭ 48 (-33.33%)
Mutual labels:  youtube-api
Ios tips
iOS的一些示例,持续更新中:1、AVFoundation 高仿微信相机拍摄和编辑 2、AVFoundation 人脸检测、实时滤镜、音视频编解码、GPUImage框架的使用等音视频相关内容 3、OpenGLES 4、LeetCode算法练习 5、iOS Crash防护和APM监控 6、WKWebView相关的内容 等........
Stars: ✭ 896 (+1144.44%)
Mutual labels:  wkwebview
Reusablenestingscrollview
An scrollView handler for UIScrollView & WKWebView and other scrollViews. Providing scrollview`s subViews reusable.
Stars: ✭ 61 (-15.28%)
Mutual labels:  wkwebview
Youtub.ly Android
An android app to download 📹 videos and songs from youtube to phone internal storage
Stars: ✭ 17 (-76.39%)
Mutual labels:  youtube-api
Tysnapshotscroll
一句代码保存截图,将 UIScrollView UITableView UICollectionView UIWebView WKWebView 网页 保存 为 长图 查看。Save the scroll view page as an image,support UIScrollView,UITableView,UICollectionView,UIWebView,WKWebView.(Support iOS13)
Stars: ✭ 709 (+884.72%)
Mutual labels:  wkwebview
Yt
The reliable YouTube API Ruby client
Stars: ✭ 674 (+836.11%)
Mutual labels:  youtube-api
Jxbwkwebview
An component WebView for iOS base on WKWebView
Stars: ✭ 646 (+797.22%)
Mutual labels:  wkwebview
Bash Snippets
A collection of small bash scripts for heavy terminal users
Stars: ✭ 8,558 (+11786.11%)
Mutual labels:  youtube-player

YoutubePlayerView

CI Status Version License Platform

The YoutubePlayerView is an open source library that helps you embed a YouTube iframe player into an iOS application. The library creates a WKWebView and a bridge between your application’s Swift code and the YouTube player’s JavaScript code, thereby allowing the iOS application to control the YouTube player.

Example

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

Requirements

Installation

Install the library via CocoaPods

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

pod 'YoutubePlayerView'

At the command line prompt, type pod install to update your workspace with the dependencies.

Tip: Remember that when using CocoaPods, you must open the .xcworkspace file in Xcode, not the .xcodeproj file.

Manually install the library

The library is also easy to install manually. Either download the source via GitHub’s download link or clone the repository. Once you have a local copy of the code, follow these steps:

  1. Open the sample project in Xcode or Finder.

  2. Select YoutubePlayerView.swift and YoutubePlayerExtras.swift. If you are opening the workspace in Xcode, these will be available under Pods -> Development Pods -> YoutubePlayerView. In the Finder, these are available in the project's root directory in the Classes directories.

  3. Drag these files and folders into your project. Make sure the Copy items into destination group’s folder option is checked.

Usage

Getting started to load video

To start playing youtube videos follow these steps:

  1. In interface builder drag a UIView to your scene.
  2. Select the Identity Inspector and change the class of the view to YoutubePlayerView.
  3. In interface builder create an IBOutlet of this view to yout view controller and name it playerView.
  4. Now in your view controller's viewDidLoad method add following code:
playerView.loadWithVideoId("GC5V67k0TAA")

Build and Run, after video loads tap on it to play the video.

Control video playback

You can also use loadWithVideoId(_ : with:) method to pass addition parameter to the view. For more information about the parameters visit Player Parameter

To play with additional parameter you can replace you code with this:

let playerVars: [String: Any] = [
    "controls": 1,
    "modestbranding": 1,
    "playsinline": 1,
    "rel": 0,
    "showinfo": 0,
    "autoplay": 1
]
playerView.loadWithVideoId("GC5V67k0TAA", with: playerVars)

There are also methods to control the playback:

func play()
func pause()
func stop()
func seek(to: allowSeekAhead:)

Handle player callbacks

The library provides a protocol YoutubePlayerViewDelegate to handle callbacks. Your class can conform to this protocol and set the delegate of the playerView to the class.

extension ViewController: YoutubePlayerViewDelegate {
    func playerViewDidBecomeReady(_ playerView: YoutubePlayerView) {
        print("Ready")
        playerView.play()
    }

    func playerView(_ playerView: YoutubePlayerView, didChangedToState state: YoutubePlayerState) {
        print("Changed to state: \(state)")
    }

    func playerView(_ playerView: YoutubePlayerView, didChangeToQuality quality: YoutubePlaybackQuality) {
        print("Changed to quality: \(quality)")
    }

    func playerView(_ playerView: YoutubePlayerView, receivedError error: Error) {
        print("Error: \(error)")
    }

    func playerView(_ playerView: YoutubePlayerView, didPlayTime time: Float) {
        print("Play time: \(time)")
    }
}

Now set the delegate of player view:

playerView.delegate = self

Author

Mukesh Yadav, [email protected]

License

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