Multiple instance of nativescript-youtubeplayer do not work on Android


#1

Hi,

I am using https://github.com/triniwiz/nativescript-youtubeplayer (nativescript-youtubeplayer plugin) and it works perfectly fine on iOS, but on Android I get an error saying: “Error occurred while initialising youtube player”. Have anybody had similar? I tried to copy demo-ng code to nativescript playground and both and Android show errors. Any help is highly appreciated.

P.s. (I am using Angular with TypeScript)
Nativescript Playground url: https://play.nativescript.org/?template=play-ng&id=YP2ZlA


#2

@bachras This plugin requires a native library so it can’t be tested with playground at this time. Were you able to reproduce the same issue in demo-ng locally?


#3

@manojdcoder thank you for your prompt reply once again. In NativeScript Playground I received multiple different. Locally it works fine works perfectly fine on iOS and on Android I get blank youtube player with an error saying: “Error occurred while initialising youtube player”. If I move view code to modal dialog iOS works fine again and on Android youtube player is not displayed at all and I get this error:

System.err: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x13
System.err: 	at android.content.res.Resources.getResourceName(Resources.java:2070)
System.err: 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:886)
System.err: 	at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
System.err: 	at android.app.BackStackRecord.run(BackStackRecord.java:834)
System.err: 	at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452)
System.err: 	at android.app.FragmentManagerImpl$1.run(FragmentManager.java:447)
System.err: 	at android.os.Handler.handleCallback(Handler.java:739)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:95)
System.err: 	at android.os.Looper.loop(Looper.java:135)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:5254)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at java.lang.reflect.Method.invoke(Method.java:372)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

#4

Are you using NativeScript v3.4.1?

Update: The demo-ng just worked fine on my end.


#5

I am using NativeScript v3.3.1. I will try to update and try again. Thanks for looking into it.


#6

I have updated to NativeScript v3.4.1 and tried demo app. Here is error I got:

System.err: java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: 
System.err: Error calling module function 
System.err: Error calling module function 
System.err: Error calling module function 
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4556)
System.err: 	at android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err: 	at android.os.Handler.dispatchMessage(Handler.java:102)
System.err: 	at android.os.Looper.loop(Looper.java:135)
System.err: 	at android.app.ActivityThread.main(ActivityThread.java:5254)
System.err: 	at java.lang.reflect.Method.invoke(Native Method)
System.err: 	at java.lang.reflect.Method.invoke(Method.java:372)
System.err: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: Caused by: com.tns.NativeScriptException: 
System.err: Error calling module function 
System.err: Error calling module function 
System.err: Error calling module function 
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: Error: com.tns.NativeScriptException: Failed to find module: "../", relative to: app/tns_modules/nativescript-youtubeplayer/angular/
System.err:     com.tns.Module.resolvePathHelper(Module.java:146)
System.err:     com.tns.Module.resolvePath(Module.java:55)
System.err:     com.tns.Runtime.runModule(Native Method)
System.err:     com.tns.Runtime.runModule(Runtime.java:530)
System.err:     com.tns.Runtime.run(Runtime.java:522)
System.err:     com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err:     android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err:     android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err:     android.app.ActivityThread.access$1500(ActivityThread.java:151)
System.err:     android.app.ActivityThread$H.handleMessage(ActivityThread.java:1364)
System.err:     android.os.Handler.dispatchMessage(Handler.java:102)
System.err:     android.os.Looper.loop(Looper.java:135)
System.err:     android.app.ActivityThread.main(ActivityThread.java:5254)
System.err:     java.lang.reflect.Method.invoke(Native Method)
System.err:     java.lang.reflect.Method.invoke(Method.java:372)
System.err:     com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
System.err:     com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
System.err: File: "<unknown>, line: 1, column: 265
System.err: StackTrace: 
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/tns_modules/nativescript-youtubeplayer/angular/index.js', line: 5, column: 10
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/app.module.js', line: 6, column: 17
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	Frame: function:'', file:'file:///data/data/com.github.triniwiz.youtubeplayer/files/app/main.js', line: 4, column: 20
System.err: 	Frame: function:'require', file:'', line: 1, column: 266
System.err: 	at com.tns.Runtime.runModule(Native Method)
System.err: 	at com.tns.Runtime.runModule(Runtime.java:530)
System.err: 	at com.tns.Runtime.run(Runtime.java:522)
System.err: 	at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:19)
System.err: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1012)
System.err: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4553)
System.err: 	... 9 more
ActivityManager: Process com.github.triniwiz.youtubeplayer (pid 7844) has died

#7

Did you run it through NPM scripts? it looks like the plugin was not compiled, you have to go to ./src and run npm run demo.ng.android.


#8

Thanks for instructions. I am getting same error with demo app as well. Any ideas?


#9

I just tried on actual device and it works fine, something wrong with emulator. Thank you for your help.


#10

Oh man, never trust Android emulators. Actually Youtube player requires Youtube app which is obviously not installed in your emulator :disappointed_relieved:


#11

Thanks again man. Plugin’s readme file needs updating to explain that it won’t work without installed youtube player on emulator or actual device.


#12

@manojdcoder sorry to bother you again. I am trying to display multiple youtube player within listview. If I set static youtube player ids it works fine, but if I use dynamic id probably doesn’t get picked up and it displays last video or doesn’t display at all. Here is my code:

Static (works):

src: "L_jWHffIx5E"
src1: "wH_0_pijbZY"
<YoutubePlayer height="50%" width="90%" 
id="player"  apiKey="AIzaSyAUm14Rg9vH_Zv9X5BeWQ8UyMMypEq4htA"
src="{{src}}" backgroundColor="gray"></YoutubePlayer>

   <YoutubePlayer height="50%" width="90%" 
id="player1"  apiKey="AIzaSyCcBApnGw_uKyx45pCOU2zScZBU5quaA6I"
src="{{src1}}" backgroundColor="gray"></YoutubePlayer> 

Dynamic( doesn’t work with ngFor or listview)

videos = [{src: "L_jWHffIx5E", id :1}, {src: "wH_0_pijbZY", id :2}];
<YoutubePlayer *ngFor="let video of videos" height="200" width="100%" 
id="video-{{video.id}}" apiKey="AIzaSyAUm14Rg9vH_Zv9X5BeWQ8UyMMypEq4htA" 
src="{{video.src}}" backgroundColor="gray"></YoutubePlayer>

do you have any ideas?


#13

I would not recommend using ids especially in Angular environment. May I know whats the purpose of giving it an id? In Angular you can anyways get the context (video object) in any event.


#14

I was testing on demo-ng app, “id” attribute was already there. I know I shouldn’t be using but I thought that is id issue. Apparently, it is apiKey issue. You can display multiple youtubePlayers but every single one has to have unique apiKey. Is that a bug or there is any workaround that?

All this happens on Android only, multiple players works with single apiKey on iOS.


#15

Are you really able to see multiple youtube players loading when you use different api keys? I haven’t tested but I guess the plugin doesn’t yet support multiple players at least in Android.


#16

Yes, I am, but that’s not a solution as I may have up to 10 players. I will try to create an issue on github.com and hopefully plugin’s owner will add multiple players feature on Android soon. Thank you for your help.


#17

when i show youtube player in radlistview its work but when i scroll and see the second video than first video are not show


#18

That’s a known issue, there were couple of solutions to handle this natively but I didn’t find time to try personally.


#19

so is there any solution ?


#20

As far as I know, no.