YouTube-Player-iOS-Helper

repository·master·Indexed 23 days ago

https://github.com/youtube/youtube-ios-player-helper

A library for iOS developers to embed and control YouTube videos within applications using the YTPlayerView component. Supports installation via CocoaPods and Swift Package Manager, and provides the YTPlayerViewDelegate protocol for handling player events and advanced parameters.

Tokens
403
Snippets
2
Records
4
Agent score
33%

What's inside youtube-ios-player-helper

  1. Install YouTube-Player-iOS-Helper via Swift Package Manager

    master

    To use Swift Package Manager, add the repository URL to your Package.swift dependencies and include YouTubeiOSPlayerHelper in your target's dependencies.

    // Add to dependencies
    .package("https://github.com/youtube/youtube-ios-player-helper.git", from: "x.y.z")
    
    // Add to target
    .target(name: "TargetName",
            dependencies: [
              "YouTubeiOSPlayerHelper"
            ]
          )
  2. Embed a YouTube video using YTPlayerView

    master

    Follow these steps to integrate the player into your iOS application using Storyboards and Objective-C:

    1. Drag a UIView of your desired size onto your Storyboard.
    2. In the Identity Inspector tab, change the view's class to YTPlayerView.
    3. Import the header in your ViewController: #import "YTPlayerView.h".
    4. Create an IBOutlet for the player in your ViewController's header file:
    @property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
    1. Load a video using its YouTube Video ID:
    [self.playerView loadWithVideoId:@