Ionic version:
4.9.0
Current behavior:
The app is crashing in iOS 13 when a youtube video is played. It was working fine in iOS 12 or earlier versions.
Expected behavior:
The app does not crash in iOS 13 when a youtube video is played.
Steps to reproduce:
import {YoutubeVideoPlayer} from '@ionic-native/youtube-video-player/ngx';
export class MyPage {
constructor(
private youtube: YoutubeVideoPlayer
) {
...
}
...
playYouTubeVideo(videoId: string) {
this.youtube.openVideo(videoId);
}
}
Other information:
The console outputs the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'MPMoviePlayerViewController is no longer available. Use AVPlayerViewController in AVKit.'
Ionic info:
Ionic:
Ionic CLI : 5.4.2
Ionic Framework : @ionic/angular 4.9.0
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.3.3
@angular/cli : 8.3.3
@ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 ([email protected])
Cordova Platforms : ios 5.0.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 16 other plugins)
Utility:
cordova-res : not installed
native-run : 0.2.8
System:
Android SDK Tools : 26.1.1
ios-deploy : 1.9.4
ios-sim : 8.0.1
NodeJS : v10.14.2
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 11.2 Build version 11B41
Thanks for the issue. I am going to close this as this is not a bug in Ionic Framework. I would recommend contacting the author of the plugin: https://github.com/ihadeed/CordovaYoutubeVideoPlayer
Hi @frenmanoj
I have the same crash, Do you find any solution?
I am looking for a solution too.
On the repos it is not possible to create an issue. I think I deposit is abandoned.
My project works on capacitor so I wanted to try the youtube plug-in for capacitor but since OS13 it does not work anymore.
So I left with the former iframe who is not top in performance but who saves for the moment.
Try to use this plugin, it did handle 13 OS, i have done a new fix to this plugin
ionic cordova plugin rm cordova-plugin-youtube-video-player
ionic cordova plugin add https://github.com/abomadi/CordovaYoutubeVideoPlayer
Thank you both for your answers.
@KyDenZ could you show me how you insert the iframe? because I try to add it but when I compile it it doesn't show it.
@abomadi thanks for your solution, I will try it. I compile my project with a capacitor, is there a problem?
@rebekris in template HTML :
<iframe
[src]="urlSecurized"
frameborder="0"
allowfullscreen
allowtransparency
allow="autoplay"
></iframe>
In Typescript :
urlSecurized: SafeResourceUrl;
constructor(private sanitizer: DomSanitizer) {
this.urlSecurized = this.sanitizer.bypassSecurityTrustResourceUrl('https://www.youtube.com/watch?v=YwSzqeBchEc');
}
Thank @abomadi, I tried your solution with capacitor and it works well.
Try to use this plugin, it did handle 13 OS, i have done a new fix to this plugin
ionic cordova plugin rm cordova-plugin-youtube-video-player
ionic cordova plugin add https://github.com/abomadi/CordovaYoutubeVideoPlayer
@abomadi , Thanks so much for the prompt fix.
Thank you both for your answers, again!
@abomadi really is fixed!!
THANKS a lot!!! <3
hi @abomadi i have a problem:
When the iphone is in silent, any video hasnt audio. this error appear on ios 13
unable to install plugin.
Environment Details:
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : ios 5.0.1
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 2.0.0
ios-sim : 8.0.2
Node : v7.9.0
npm : 4.2.0
OS : macOS
Xcode : Xcode 11.0 Build version 11A420a
Error :
ionic cordova plugin add https://github.com/abomadi/CordovaYoutubeVideoPlayer
>UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Failed to
fetch plugin https://github.com/abomadi/CordovaYoutubeVideoPlayer via registry.
>Check your connection and plugin name/version/URL.
>Failed to get absolute path to installed module (node:16794) 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.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Most helpful comment
Try to use this plugin, it did handle 13 OS, i have done a new fix to this plugin
ionic cordova plugin rm cordova-plugin-youtube-video-player
ionic cordova plugin add https://github.com/abomadi/CordovaYoutubeVideoPlayer