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

bug: App close on hardware back button press when video is open in full screen. #19356

Closed
pateldi1524 opened this issue Sep 16, 2019 · 15 comments
Labels

Comments

@pateldi1524
Copy link

Bug Report

Ionic version:

[x] 4.x

Current behavior:
I have an HTML video player in my app,
<video controls> <source [src]="videoUrl" type="video/mp4"> </video>

Which loads video from device gallery and show in screen.
Video controls have option to open video in full screen. when the video is in full screen, the app closes instead of go back on click on device hardware back button.

Expected behavior:
It should close the video full screen and go back to the previous screen.

Ionic info:

Ionic:

   Ionic CLI                     : 5.0.3
   Ionic Framework               : @ionic/angular 4.6.0
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 8.0.0
   Cordova Platforms : android 7.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 18 other plugins)

Utility:

   cordova-res : 0.4.0
   native-run  : 0.2.6

System:

   Android SDK Tools : 26.1.1 (/Users/divyesh/Library/Android/sdk)
   ios-deploy        : 1.9.2
   NodeJS            : v11.4.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.2.1 Build version 10E1001
@ionitron-bot ionitron-bot bot added the triage label Sep 16, 2019
@yogeshpatil143
Copy link

Please use the Cordova video player plugin.

URL: https://ionicframework.com/docs/native/video-player

It helps you bro.

@pateldi1524
Copy link
Author

I wants to display video gallery. which is not possible with the above plugin.

@yogeshpatil143
Copy link

yogeshpatil143 commented Sep 17, 2019

Hi,

For video gallery, make sure bind thumbnails for interactive view and play the video by click event.
That's i guess...

@josephlodero
Copy link

@pateldi1524 did you find a solution for this?

@pateldi1524
Copy link
Author

No.

@pabloroxo
Copy link

I'm facing this problem too. My videos are in the assets folder, it's a video gallery for an interative book app. I've tried this solution but didn't work. I'll wait here. Thanks.

@pabloroxo
Copy link

pabloroxo commented Oct 7, 2019

Another behaviour I noticed:

1 - Open page
2 - Play video
3 - Go fullscreen
4 - Exit fullscreen
5 - Press back button
--> The entire app closes

But if we don't go fullscreen:

1 - Open page
2 - Play video
3 - Press back button
--> The back button works properly


Now I'm using a modal just to store the player:

1 - Open page
2 - Open modal with the video
3 - Play Video
4 - Go fullscreen
5 - Exit fullscreen
6 - Close modal (pressing X button on top right corner)
7 - The page is showed again
8 - Press back button
--> The back button works properly

But if we press back button instead of closing modal:

1 - Open page
2 - Open modal with the video
3 - Play Video
4 - Go fullscreen
5 - Exit fullscreen
6 - Press back button
--> The entire app closes

@josephlodero
Copy link

@pabloroxo same problem with me.. but this problem will only happens with API 28 and 29. lower version is working fine

@Mr-Anonymous
Copy link

I have the same issue. I open Vimeo player that is embedded inside an iFrame through ionic android app and it works fine if the full screen button in the player is not clicked. But when playing the video in fullscreen, if the back button is pressed, it straight away closes the app. Although I have some code for $ionicPlatform.registerBackButtonAction(function (e) { .. }, 100);, it seems this event is not even fired and the app gets closed irrespective.

What can be done to get around this problem?

@clemishow
Copy link

Same here !

@r0b1337
Copy link

r0b1337 commented Oct 24, 2019

I'm facing the same problem !

@M-Rizk
Copy link

M-Rizk commented Nov 13, 2019

Any update???
I'm facing the same issue when opening: image, video or html page in full screen mode

@josephlodero
Copy link

Hi. If you guys using cordova here's a solution apache/cordova-android#822 cheers

@paulstelzer
Copy link
Contributor

As @josephlodero mentioned that is an issue with cordova android. There is already a PR, but hasn't merged yet -> apache/cordova-android#823

So we need to hope they will add it soon - I am waiting for it, too :D

@ionitron-bot
Copy link

ionitron-bot bot commented Dec 20, 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 Dec 20, 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

9 participants