cordova-plugin-streaming-media icon indicating copy to clipboard operation
cordova-plugin-streaming-media copied to clipboard

Back button on Android requires several (at least 2) taps (clicks) to close.

Open dimshik100 opened this issue 7 years ago • 17 comments

What version of Streaming-Meda-Cordova-Plugin are you using? 2.2.0

What version of Cordova are you using? cordova-android 7.1.1

What devices are affected? Samsung Galaxy S8+, Samsung Galaxy S8

Please describe the issue in detail, with relevant code samples This package is used with: ionic-angular: 3.9.2, @angular/core: 5.2.9, @ionic-native/streaming-media: 4.15.0

The play functionality streamingMedia.playVideo(...) is placed inside ngAfterViewInit angular lifecycle hook inside an ionic component. This component visibility is triggered by an *ngIf directive of its parent.

What did you expect to happen? Tapping the back button just once should close the video.

What actually happened? After one tap on the back button, nothing happens. Only after the second tap, the video closes. This behavior is inconsistent, as several times the video did close after only one tap.

dimshik100 avatar Oct 14 '18 08:10 dimshik100

Can you confirm you are experiencing this on a device and not on an emulator?

shamilovtim avatar Oct 14 '18 22:10 shamilovtim

I can't reproduce this. If you continue to have this problem please record a video of the behavior and share the code that's causing this

shamilovtim avatar Oct 14 '18 22:10 shamilovtim

Good morning,

I'm facing the same issue on Samsung Galaxy S7 Code:

var options = { successCallback: function() { console.log("Video was closed without error."); }, errorCallback: function(errMsg) { console.log("Error! " + errMsg); }, // orientation: 'landscape', shouldAutoClose: true, // true(default)/false controls: true // true(default)/false. Used to hide controls on fullscreen }; var uri = getUriMedia(); window.plugins.streamingMedia.playVideo(uri, options);

My enviorment: cordova 7.1.0 cordova- android: 6.3.0

Description: when a video is selected, the player is throwed and the video is reproduced as expected. But when I try to go back tapping "backbutton" the player does not respond and the controler get freezed.

This issue is present on device.

Thank you very much!

Borja4 avatar Oct 16 '18 07:10 Borja4

I am facing this issue too.

patwaswapnil avatar Nov 20 '18 07:11 patwaswapnil

Hi

Same issue for me on Galaxy S7

Cordova 8.1.2 Android 8.0.0

$(document).on('click', '.btn-play', function(e) {

var videoUrl = $(this).data('href');

//console.log(videoUrl);
	
// Just play a video
window.plugins.streamingMedia.playVideo(videoUrl);

// Play a video with callbacks
var options = {
	successCallback: function() {
		console.log("Video was closed without error.");
	},
	errorCallback: function(errMsg) {
		console.log("Error! " + errMsg);
	},
	orientation: 'landscape',
	shouldAutoClose: true,  // true(default)/false
	controls: true // true(default)/false. Used to hide controls on fullscreen
};

window.plugins.streamingMedia.playVideo(videoUrl, options);

});

But some times it's work and i can't reproduce it

Thank a lot

a-polounovsky avatar Dec 01 '18 03:12 a-polounovsky

Because I've been unable to reproduce this issue, I'm going to need to see some sort of screen recording of what exactly is happening on the screen at the time of the button being pushed. I suspect that the first back tap is minimizing the video controls, which I assume is desirable. However I can remove that functionality if need be

shamilovtim avatar Dec 01 '18 22:12 shamilovtim

After one tap on the back button, the video close but she play again (close + open at begin).

At second tap it's ok

Same on emulator with nexus and android 8.0

I'm going to make a video to see what's happen exactly

a-polounovsky avatar Dec 05 '18 03:12 a-polounovsky

Can anyone provide a video of this behavior please?

shamilovtim avatar Dec 20 '18 20:12 shamilovtim

I can confirm that the first tap of the back button removes the video controls. I noticed this on the audio player and it seems undesirable to have to click back twice to close the audio player. As for the video player, can the controls go away after a few seconds and reappear when the video is tapped?

cmorbitzer avatar Jan 07 '19 21:01 cmorbitzer

Use below line only once window.plugins.streamingMedia.playVideo(videoUrl);

it will work fine!!

yogeshgaikwad avatar Jan 30 '19 08:01 yogeshgaikwad

Hi

So bad for me....... it's work !

I called the video 2 times sorry, very bad......

a-polounovsky avatar Feb 01 '19 10:02 a-polounovsky

Glad you got it working!

shamilovtim avatar Feb 01 '19 22:02 shamilovtim

I'll be revisiting this issue this week and hope to have a solution

shamilovtim avatar Mar 19 '19 18:03 shamilovtim

Hi, I'm having the same issues using a Pixel 2 device (not emulator). The number of back click required can vary from 2 to 8 and I think it might be a necessary delay between the clicks. I would really like some update about this issue.

Thank you!

clanglois421 avatar Apr 10 '19 18:04 clanglois421

I can confirm the that there is a back button issue with this plugin on Samsung Galaxy S8 (maybe all devices with a virtual back button?). I think the problem is related to the navigation which cannot be closed by using the back button on the Samsung S8. This makes the user click several times without anything happen. Once the navigation eventually goes away automatically, the player closes at first click. The issue can be seen in this video: https://drive.google.com/open?id=1YDO6M5P5gSwpOXc9Q_Ip0fW3Zxj_q3yE

(On a Samsung S7, the navigation closes at first click, then the player closes on second click).

Plugin version: 2.2.0.

Thanks for a great plugin! Hopefully this issue can be addressed.

nettopuis avatar Feb 20 '20 12:02 nettopuis

I'm experiencing this same issue on a Pixel 4 real device.

this.streamingMedia.playVideo(streamurl,options);

The video loads and plays correctly. shouldAutoClose works once the video gets to the end but no matter how many times I try going back (using back swipe) the video will not close.

Has anybody found a solution to this?

stharvey avatar Mar 06 '20 10:03 stharvey

Hey just to update you all on the status of this plugin. I no longer contribute to Cordova full time. If your org needs work on this plugin please consider funding it and hiring me for improvements or otherwise consider donating your time and submitting a PR. Thanks!

shamilovtim avatar Mar 06 '20 17:03 shamilovtim