Ionic-native: Update XCDYouTubeKit

Created on 9 Aug 2017  路  26Comments  路  Source: ionic-team/ionic-native

I'm submitting a ... (check one with "x")
[ ] bug report
[X ] feature request

Current behavior:
The current youtube player used for IOS (https://github.com/0xced/XCDYouTubeKit) is 3 years behind, and no longer compatible with the API. A lot of videos wont play anymore.

Can you update the lib?

improve docs improve plugin

All 26 comments

For anyone running into this: I created a fork with the updated plugin you can use:
https://github.com/Remco75/CordovaYoutubeVideoPlayer

This is based on the https://github.com/ihadeed/CordovaYoutubeVideoPlayer fork, only with updated XCDYouTubeKit.

@ihadeed , we can use my fork form now on, or you can merge my work in your fork, but I cannot make a PR against your fork.

ehm, is there any activity on this at all? Lot's of issues are open, no contributer seems to respond 馃憥

Can we help out? or is it a Ionic thing?

The same issue here. None of the videos for me will play.

@sylwester- See my second comment. Use my fork and they will play

But it would be better if someone replied so we can merge it and my fork can go the way of the dodo once more ;-)

@Remco75 - do you still use navite with your updated plugin? If I follow the instructions I get "YoutubeVideoPlayer not found"

Hmm, that's not supposed to happen. My fork is essentially the same as the version from @ihadeed , but with the a more recent version of the native player.
Did you try removing the plugin completely and the re-add it?
Sometimes it even is needed to remove / add your platform again .

Also, did you get it to work before? and is this only on IOS?

@Remco75 - I think I might be missing something silly here. Let me show you what I do:

1) ionic start myApp tabs
2) cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer
3) in my home.ts I add

play_video() { YoutubeVideoPlayer.openVideo('videoed', function(result) { console.log('YoutubeVideoPlayer result = ' + result); }); }

I am not importing the plugin anywhere which might be an issue. Should I use Ionic Native?

What I get is: "Cannot find name 'YoutubeVideoPlayer'."
(iOS only)

@sylwester- in this code you do not use my fork ;-)
in step 2 do this: cordova plugin add https://github.com/Remco75/CordovaYoutubeVideoPlayer

Then use it with ionic native (see their page)
https://ionicframework.com/docs/native/

Btw, you can get it to work without using ionic native, but they wrap all the stuff in a nice injectable: wat cleaner, so always use that!

@Remco75 - this is what I get now:

Error: Failed to fetch plugin https://github.com/Remco75/CordovaYoutubeVideoPlayer via registry. Probably this is either a connection problem, or plugin spec is incorrect. Check your connection and plugin name/version/URL. Failed to get absolute path to installed module

hmm try ionic cordova plugin add https://github.com/Remco75/CordovaYoutubeVideoPlayer
Should work....
Which ionic cli version and / or cordova version are you using. Not all versions can get plugins by link....

@Remco75 - nope - still no luck. other plugins in GitHub work fine

Really strange. I Tried to replicate it. What I did:
ionic cordova plugin rm cordova-plugin-youtube-video-player
ionic cordova plugin add https://github.com/Remco75/CordovaYoutubeVideoPlayer
instals without a problem....
can you clone my repo without problems?

@Remco75 - got to to work 馃憤

The problem was with . sourcemaps. it contained conflicting location for the same plugin. I removed the dir and also any reference to youtube plugin from package.json and config.xml

After that I was able to add plugin as per above and it works great!

Ah! Good to hear. Could not get my head around it, but this makes sense. Now lets hope someone updates the main repo, or merges my fork. But I don't have the impression that anyone really watches this repo closely.

I agree. I would think that this is very popular plugin.

@Remco75 - it seems that in the ionic 3.8 plugin fails with:

2017-11-08 10:31:42.490987+0100 xxx[50013:18719885] 8pc0Q3nlUag 2017-11-08 10:31:42.532649+0100 xxx[50013:18719885] THREAD WARNING: ['YoutubeVideoPlayer'] took '40.102783' ms. Plugin should use a background thread. 2017-11-08 10:31:42.547630+0100 xxx[50013:18719885] [] <<<< AVOutputDeviceDiscoverySession (FigRouteDiscoverer) >>>> -[AVFigRouteDiscovererOutputDeviceDiscoverySessionImpl outputDeviceDiscoverySessionDidChangeDiscoveryMode:]: Setting device discovery mode to DiscoveryMode_Presence (client: xxx) 2017-11-08 10:31:42.870590+0100 xxx[50013:18719885] CredStore - performQuery - Error copying matching creds. Error=-25300, query={ class = inet; "m_Limit" = "m_LimitAll"; "r_Attributes" = 1; sync = syna; }

As always, any help would be appreciated.

@sylwester- I will have to look into it, but I have very limited time atm. (they should have just solved this, then I would be out of the loop ;-)
Anyway, I will try to find some time in the weekend. If you find anything new: post back here

@Remco75 man, very thanks for you support! Your fork work well. I was using from ionic documentation and have encountered some problems with a lot of videos! Your fork is working Ok! Thanks! Ionic team, please, help us maintaining native libs updated!

@Remco75 - looks like the XCDYouTubeKit lib was updated on the 23rd of Sep. Maybe that will fix the issues with some videos not playing on iOS11.

https://github.com/0xced/XCDYouTubeKit/releases

Really appreciate your help with this plugin.

Closed because of the latest releases

This has not been fixed by the latest release.
@danielsogl - could you please use @Remco75 fork. It has been tested on variety of different devices.

@danielsogl Thnx for looking into this. If I can be of any assistance, please let me know. I would be nice to have the dependencies of the plugin managed somehow. Any thoughts on this?

I'm not able to use the Ramco75's branch.

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin https://github.com/Remco75/CordovaYoutubeVideoPlayer via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module
(node:7608) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@Remco75
While running ionic cordova buiild android
Log:

Discovered plugin "cordova-plugin-youtube-video-player" in config.xml. Adding it to the project
Failed to restore plugin "cordova-plugin-youtube-video-player" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin git+https://github.com/Remco75/CordovaYoutubeVideoPlayer.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

Was this page helpful?
0 / 5 - 0 ratings