Pedro H Pinheiro
Pedro H Pinheiro

Reputation: 15

Ionic Cordova Themeable Browser - prevent youtube video to play in background

I’m using themeable browser to view web pages, and some of them have youtube videos in iframe. I’m having trouble with the video still running in the background (switch app or lock screen). Is there any configuration of the Themeable Browser or Ionic Cordova to prevent this behavior?

Web pages are under my control, if the solution is better on the page itself.

My Environment:

Ionic:

ionic (Ionic CLI): 4.3.1 Ionic Framework: Ionic-angular 3.9.2 @ ionic / app-scripts: 3.0.0

Cordova:

Cordova (Cordova CLI): 8.0.0 Cordova Platforms: android 7.0.0 Cordova Plugins: no whitelisted plugins (11 total plugins)

System:

Android SDK Tools: 26.1.1 (/ home / phpinheiro / Android / Sdk) NodeJS: v10.1.0 (/home/linuxbrew/.linuxbrew/Cellar/node/10.1.0/bin/node) npm: 5.6.0 OS: Linux 4.18

Plugin: cordova-plugin-themeablebrowser 0.2.17 “ThemeableBrowser”

Thanks!

Upvotes: 0

Views: 355

Answers (1)

DaveAlden
DaveAlden

Reputation: 30356

Since cordova-plugin-themeablebrowser is a fork of the official cordova-plugin-inappbrowser, it does not contain the more recent fixes from the latter, including the ability to pause playing videos when entering the background.

This issue was raised against cordova-plugin-inappbrowser as CB-11013 and subsequently added as a feature via the shouldPauseOnSuspend=yes option.

However, this change has not been patched over to cordova-plugin-themeablebrowser.

So your options are to switch over to using cordova-plugin-inappbrowser, find a fork of cordova-plugin-themeablebrowser that has been patched, or fork cordova-plugin-themeablebrowser and patch it yourself.

Upvotes: 0

Related Questions