Git Product home page Git Product logo

cordovayoutubevideoplayer's Introduction

#Cordova YoutubeVideoPlayer Plugin

Play Youtube Videos in a native Video Player on Android & iOS.

This fork works on Android 6, and does not force landscape mode on Android.

iOS plugin uses XCDYouTubeKit by Cédric Luthi:
https://github.com/0xced/XCDYouTubeKit

Android version (up to 4.4) uses OpenYoutubeActivity by Keyes Labs:
https://code.google.com/p/android-youtube-player

Android version (5.0+) uses YouTube Android Player API: https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubePlayer

Android with YouTube App Version 111662130 requires a workaround to resolve an App issue: https://code.google.com/p/gdata-issues/issues/detail?id=8244

##Installation

cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer

##Usage

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

<preference name="YouTubeDataApiKey" value="[YOUR YOUTUBE API]" />

with your own YouTube Key.

For more information: https://developers.google.com/youtube/v3/getting-started

The callback is called when the video window is closed. (Work in Progress - should be working for IOS).

##Author

Adrien Glitchbone

d0cz

trakout

##License

CordovaYoutubeVideoPlayer is available under the MIT license. See the LICENSE file for more information.
XCDYouTubeKit is available under the MIT license.
OpenYoutubeActivity is available under the Apache License 2.0.

cordovayoutubevideoplayer's People

Contributors

arctouch-brunowolff avatar axelcostaspena avatar davidgv88 avatar glitchbone avatar ihadeed avatar javierabrego avatar jonsmart avatar markdegrootnl avatar trakout avatar trinnguyen avatar zackexplosion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordovayoutubevideoplayer's Issues

in iOS, Page close suddenly when trying to open Youtube

Console Log seems returning some error

[XCDYouTubeKit] Video operation finished with error: The operation couldn’t be completed. (XCDYouTubeVideoErrorDomain error -3.)

Domain: XCDYouTubeVideoErrorDomain
Code: -3
User Info: {
}

Black screen when playing Youtube video second time.

On Android devices when we play youtube video for the first time it works perfectly but once we close video either by back button press or auto closes on video finish. now if we try to open the video on the same page then youtube video player is coming with black screen. It would be of great if you help.

IOS build Fail

Hi, @ihadeed

"@ionic/angular": "^4.11.7",
"@ionic-native/youtube-video-player": "^5.21.4",
"cordova-plugin-youtube-video-player": "2.4.0",
"@angular/common": "~8.1.2",
"@angular/compiler": "~8.1.2",
"@angular/core": "~8.1.2",
"cordova-android": "8.1.0",
"cordova-ios": "5.1.1",

It works well on Android.

but, It cannot be build in IOS...

[cordova] [cordova] ** BUILD FAILED ** [cordova] [cordova] [cordova] The following build commands failed: [cordova] CompileC /Users/ctsoft/Library/Developer/Xcode/DerivedData/edume-aozxplehlcprepgdnaexsfzmsuow/Build/Intermediates.noindex/edume.build/Debug-iphonesimulator/edume.build/Objects-normal/x86_64/YoutubeVideoPlayer.o /Users/ctsoft/Desktop/dev/edume/platforms/ios/edume/Plugins/cordova-plugin-youtube-video-player/YoutubeVideoPlayer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler [cordova] (1 failure) [cordova] xcodebuild: Command failed with exit code 65

Is there anything else I need to setting?

Here in the 'JonSmart/CordovaYoutubeVideoPlayer' plug-in, the build succeeds.

Please Help me.

Where to place Android YouTubeDataApiKey in Capacitor project

Describe the bug
Documentation should be upgraded to clearly show where to place Android YouTubeDataApiKey when using Capacitor.

To Reproduce
Steps to reproduce the behavior:

  1. Build new Ionic project that is using Capacitor.
  2. Add CordovaYoutubeVideoPlayer and implement code per documentation.
  3. iOS works well.
  4. Can't run Android project with CordovaYoutubeVideoPlayer, but I cannot find out where to declare YouTubeDataApiKey.

Expected behavior
Would like to see this documented in README, especially with growing popularity of Capacitor. This is a good plugin and it should be easy for Capacitor users to implement as well.

Using
@ionic/[email protected]
@capacitor/[email protected]
@ionic-native/[email protected]
[email protected]

In the meantime, if anyone knows the answer to this I would appreciate the insight.

Audio playing through ear speaker only

Issue: Audio is very quiet, and seems to play through earpiece speaker only (not the external speakers at bottom of phone).

Details:
"cordova-ios": "^5.1.1",
"cordova-plugin-youtube-video-player": "^2.4.0",
"@ionic-native/youtube-video-player": "^4.20.0",

iOS version 13.5.1

Build Fails

I got this error form xCode when building the project
I use xcode 11.4, any help plz with that

: Library not found for -lXCDYouTubeKit

The video on Android stops after a few seconds to pause.

The first video on Android works fine, but each subsequent video is stoped immediately after the start to pause. The screen turns black. The focus is lost, and it is not possible to continue it manually. If you switch to another app and then return, the video waits for the manual continuation of viewing. This happened after the recent Google updates to WebView. How do I eliminate these pauses?
In config.xml recorded:
preference name="AllowInlineMediaPlayback" value="true"
preference name="MediaPlaybackRequiresUserAction" value="false"

Video stuttering and pausing while loading.

At some point (somewhere towards the end of videos), the playback "catches up" and fast forwards through the video to the correct point.

I've noticed it has something to do with cell connection/data. Haven't noticed the problem on WIFI.

Playback of the video without closing the video player produces the correct result.

Versions:
"cordova-ios": "^5.1.1",
"cordova-plugin-youtube-video-player": "^2.4.0",
"@ionic-native/youtube-video-player": "^5.22.0",

iOS version 13.3.1

Analysis about Youtube Quotas

Hi Everyone, first of all i just need to inform, i don't have sure if it's a bug, or a common thing since i don't have a lot of experience in Ionic with this plugin.

Description
I have a Ionic application with a lot of pages, and one of them is the only page with this plugin, wich is used to display a list of youtube videos from a chanel and where i can reproduce each video.

Issue
When i see the google dashboard to count the usages\quotas of "YouTube Data API v3" i see a lot of usages ( like 200 or 500 ) when i only access the page one time.

Expected behavior
If i access just 1 time, the page wich is using "YouTube Data API v3", i expect the quota increase 1 as well

Someone have this same Issue?

How to disable controls?

Hello, Thank you for making a wonderful plugin.
This is not an issue but I want to disable controls in the player, is there any way to disable controls and I want to disable open youtube by clicking video name and youtube button. please help. Thank you in advance :)

android 13 does not open youtube player in android

Describe the bug
This plugin working nice in android 8.1.0 but this plugin does not working in android 13 version please give me solutions. i have added screenshots below.

Screenshots
MicrosoftTeams-image

Smartphone (please complete the following information):

  • Device: [e.g. One Plus 10R]
  • OS: [e.g. Android 13.1]
  • Version [e.g. ionic 7.0.1]

iPhone app crash when video is deleted from YouTube

Hello @ihadeed,
Greetings for the day!!

I am developing an ionic 4 app where I have informative videos which I am fetching from YouTube channel and display on the app. This plugin works perfectly for the available videos but when a video is deleted from the YouTube at that time in android is shows error like a video is not available which is correct but in iOS, my app is crashing.

Below are the plugin versions which I am using:
"cordova-plugin-youtube-video-player": "^2.4.0"
"@ionic-native/youtube-video-player": "^5.20.0"
"cordova-ios": "^5.1.1"

It will be really appreciated if you can fix this issue.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.