I have a webpage that "plays videos" using sprite sheets. The page is optimized for mobile devices, so it can be downloaded to Android and iOS WebViews. I would like to know when the page is visible, so only after that I can play the video. I do not want users to capture the video stream because the WebView is behind the view.
I see that some developers can wait until the whole page finishes pulling all the assets from the page before making it visible to the user. Therefore, I do not want the “video” to begin before this time. I cannot rely on window.onload because this event fires even if the WebView is not displayed on the screen or not displayed.
How can I do this from the client side, with some JavaScript, preferably?
[Edit] To be clear, I mean that I have no control over my own WebView. You can load web pages into a WebView that do not appear on the screen, and then call up the view or add it to the screen layout later. My problem is that when my webpage url loads into the webview, I cannot tell when the webview will appear on the screen.
javascript android ios
user2122422
source share