|License||Apache Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
|Platforms||osx 10.11, requires ARC|
|Authors||, , ,|
To run the example project; clone the repo, and run
pod install from the Project directory first. For a simple tutorial see this Google Developers article – Using the YouTube Helper Library to embed YouTube videos in your iOS application.
YouTube-Player-iOS-Helper is available through CocoaPods, to install
it simply add the following line to your Podfile:
pod "youtube-macos-player-helper", "~> 0.1"
After installing in your project and opening the workspace, to use the library:
- Drag a UIView the desired size of your player onto your Storyboard.
- Change the UIView’s class in the Identity Inspector tab to YTPlayerView
- Import "YTPlayerView.h" in your ViewController.
- Add the following property to your ViewController’s header file:
@property(nonatomic, strong) IBOutlet YTPlayerView *playerView;
- Load the video into the player in your controller’s code with the following code:
- Run your code!
See the sample project for more advanced uses, including passing additional player parameters and
working with callbacks via YTPlayerViewDelegate.
Sun, 28 Apr 2019 10:04:04 +0000