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

[4.x.x] YoutubeVideoPlayer + iOS 13 - App is crashing when playing a youtube video #19612

Closed
frenmanoj opened this issue Oct 10, 2019 · 11 comments
Labels

Comments

@frenmanoj
Copy link

frenmanoj commented Oct 10, 2019

Bug Report

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 (cordova-lib@9.0.1)
   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
@ionitron-bot ionitron-bot bot added the triage label Oct 10, 2019
@liamdebeasi
Copy link
Contributor

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

@rebekris
Copy link

Hi @frenmanoj
I have the same crash, Do you find any solution?

@KyDenZ
Copy link
Contributor

KyDenZ commented Oct 12, 2019

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.

@abomadi
Copy link

abomadi commented Oct 13, 2019

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

@rebekris
Copy link

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?

@KyDenZ
Copy link
Contributor

KyDenZ commented Oct 14, 2019

@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.

@frenmanoj
Copy link
Author

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.

@rebekris
Copy link

Thank you both for your answers, again!
@abomadi really is fixed!!
THANKS a lot!!! <3

@rebekris
Copy link

rebekris commented Oct 18, 2019

hi @abomadi i have a problem:
When the iphone is in silent, any video hasnt audio. this error appear on ios 13

@coddark
Copy link

coddark commented Oct 31, 2019

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.

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 30, 2019

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.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants