Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix for failing get_video_info api #19

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer
YoutubeVideoPlayer.openVideo('YOUTUBE_VIDEO_ID', function(result) { console.log('YoutubeVideoPlayer result = ' + result); });
```

For Android 5.0+ you will need to add the following to config.xml
For Android 5.0+ and iOS you will need to add the following to config.xml

```xml
<preference name="YouTubeDataApiKey" value="[YOUR YOUTUBE API]" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,19 @@
#import "YoutubeVideoPlayer.h"
#import "XCDYouTubeKit.h"
#import <AVKit/AVKit.h>
#import <Cordova/NSDictionary+CordovaPreferences.h>

@implementation YoutubeVideoPlayer

- (void)pluginInitialize
{
NSString *api_key = [self.commandDelegate.settings cordovaSettingForKey:@"YouTubeDataApiKey"];

if (api_key != nil) {
[XCDYouTubeClient setInnertubeApiKey: api_key];
}
}

- (void)openVideo:(CDVInvokedUrlCommand*)command
{

Expand Down
13 changes: 10 additions & 3 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0" id="cordova-plugin-youtube-video-player" version="2.4.0">
<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0" id="cordova-plugin-youtube-video-player" version="2.4.1">

<name>CordovaYoutubeVideoPlayer</name>

Expand Down Expand Up @@ -56,8 +56,15 @@
</feature>
</config-file>


<framework src="XCDYouTubeKit" type="podspec" spec="~> 2.7" />
<podspec>
<config>
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="XCDYouTubeKit" git="https://github.com/armendh/XCDYouTubeKit.git" branch="master"/>
</pods>
</podspec>

<header-file src="platforms/ios/YoutubeVideoPlayerProject/Plugins/com.bunkerpalace.cordova.YoutubeVideoPlayer/YoutubeVideoPlayer.h"/>
<source-file src="platforms/ios/YoutubeVideoPlayerProject/Plugins/com.bunkerpalace.cordova.YoutubeVideoPlayer/YoutubeVideoPlayer.m"/>

Expand Down