nchutchind / cordova-plugin-streaming-media

Simple plugin for loading full screen streaming video or audio.
MIT License
392 stars 284 forks source link

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

Open dimshik100 opened 6 years ago

dimshik100 commented 6 years ago

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.

shamilovtim commented 6 years ago

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

shamilovtim commented 6 years ago

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

Borja4 commented 6 years ago

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!

patwaswapnil commented 5 years ago

I am facing this issue too.

a-polounovsky commented 5 years ago

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

shamilovtim commented 5 years ago

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

a-polounovsky commented 5 years ago

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

shamilovtim commented 5 years ago

Can anyone provide a video of this behavior please?

cmorbitzer commented 5 years ago

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?

yogeshgaikwad commented 5 years ago

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

it will work fine!!

a-polounovsky commented 5 years ago

Hi

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

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

shamilovtim commented 5 years ago

Glad you got it working!

shamilovtim commented 5 years ago

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

clanglois421 commented 5 years ago

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!

nettopuis commented 4 years ago

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.

stharvey commented 4 years ago

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?

shamilovtim commented 4 years ago

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!