InAppBrowser issue solved (video/audio does not stop playing)

  • 1
  • Idea
  • Updated 5 years ago
Hi,

This issue has a lot of topics... (https://www.google.fr/search?hl=fr&q=...)

Situation : you are using InAppBrowser, and browse extranel weblinks.
If you are playing a video into InAppBrowser, and touch backbutton (to go back to your app), the sound of the video is still playing.
In fact, InAppBrowser seems be not closed, and perhaps it will impact performances.

Anywhay, there is a trick to force close InAppBrowser when you touch backbutton :


function mute(ref){
ref.close()
window.onfocus=function(){}
}
var ref=window.open('http://www.google.fr'_blank','location=yes')
window.onfocus=function(){mute(ref)}


Explanation :
when you go back to your app (by touching the backbutton),
the window.onfocus event is starting, and the "mute" function is launched
this function force to close InAppBrowser and reset the onfocus event (you need close InAppBrowse once ;)
Photo of Yann S

Yann S

  • 214 Posts
  • 7 Reply Likes

Posted 7 years ago

  • 1
Photo of Yann S

Yann S

  • 214 Posts
  • 7 Reply Likes
next InAppBrowser issue to solve... play video in fullscreen mode
Photo of Amir

Amir

  • 8261 Posts
  • 263 Reply Likes
Thanks Yann

Really helpful
Photo of abhiram

abhiram

  • 16 Posts
  • 0 Reply Likes
Hi Yann and Amir, is the solution found for this problem yet? The videos in the inappbrowser play fullscreen on ios on my app but they do not for android. Thank you.
Photo of Yann S

Yann S

  • 214 Posts
  • 7 Reply Likes
Play Fullscreen is not working :/
there is no fix for my knowledge