Re: How to detect inactivity, so videostreaming stops.
Posted: Thu Feb 08, 2018 10:32 pm
Android:
I wonder why this method works for some others (as reported on stackoverflow, but they are using Chrome or Firefox).
I also tested here a LC timer together with a javaScript callback. That relies upon that the power button would disable javaScript. This is most probable different between Android versions. So no help here.
I looked also into the YouTube API but that requires info about ActivityState from the browser. There is a solution and I overlooked that it is for Apache cordova (see link below)
** So there arises a feature request for LC to get the ActivityState for Android.
Working with the video element of HTML5 relies also on a combination of visibility, focus and blur, which all are not affected by a screen-off (power button).
In sum: Sorry, can't give more help. This is too much hardware related.
IDE:
My script above works on Mac, indeed sadly not on Windows. But for a desktop version there are more methods available, you know.
____
p.s. The things you mention in your last post relate exactly to **
Apache cordova fires a "pause" event when the power button is pressed and you can use that.
https://stackoverflow.com/questions/368 ... -is-presse
So it's a feature request (**) for LC rather than a bug, not only related to the browser widget.
I wonder why this method works for some others (as reported on stackoverflow, but they are using Chrome or Firefox).
I also tested here a LC timer together with a javaScript callback. That relies upon that the power button would disable javaScript. This is most probable different between Android versions. So no help here.
I looked also into the YouTube API but that requires info about ActivityState from the browser. There is a solution and I overlooked that it is for Apache cordova (see link below)
** So there arises a feature request for LC to get the ActivityState for Android.
Working with the video element of HTML5 relies also on a combination of visibility, focus and blur, which all are not affected by a screen-off (power button).
In sum: Sorry, can't give more help. This is too much hardware related.
IDE:
My script above works on Mac, indeed sadly not on Windows. But for a desktop version there are more methods available, you know.
____
p.s. The things you mention in your last post relate exactly to **
Apache cordova fires a "pause" event when the power button is pressed and you can use that.
https://stackoverflow.com/questions/368 ... -is-presse
So it's a feature request (**) for LC rather than a bug, not only related to the browser widget.