Discussion Forums  >  WebViews and HTML for Mobile

Replies: 3    Views: 119

buzzbt
Android Fan
Profile
Posts: 233
Reg: Nov 14, 2011
las vegas
6,530
09/08/12 09:06 AM (13 years ago)

back button on the app dsn't controls the pages 100%?

Hi all unanswered ? For long time I am asking this for the 3rd time any one can help ? Or David@buzztouch? Thanks! The back button on the app controls the pages on the app right?. When viewing a webpage on a Custom URL/webpage the website/page is 'encapsulated' inside that app page & therefore If you open more than one HTML pages & stream video or audio when tapping the back button in the navigation bar the video or audio doesn't stop playing. Vers 1:4 The only way to stop playing is tap on stop button inside HTML before you tapping the back button or if you need to close them you have to go back to home screen menu and click menu on your phone and choose terminate . I tout if I use Vers 2:0 will solve the problem 2:0 no way to stop it ether you have to restart the phone. My ? is Is there any way wane I tap the back button on the app to lose the pages to make it lost? Thanks!!!!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/08/12 10:41 PM (13 years ago)
You may not have got any replies because it's tough to understand what you're asking. I think. If you're asking how to "stop video / audio" with the back button..it depends on what's playing the video. It sounds like your loading a web page that has embedded media that starts playing. There are countless ways to play media in HTML so it's tough to say what your HTML is doing. If the media is "taking control" of the iOS hardware and software that plays the media, then you "close" the HTML (navigate away from it), then yes, you wont' be able to stop it. Think of it like this...when you load the HTML, you're saying... "hey iOS, start playing this media" When you navigate away from the UIViewController (tech speak) that loaded the HTML (inside a UIWebView), you're not saying to iOS "and stop playing the media" You're not saying this because you your app has no way to know that something is playing - right? It's in the HTML, it's not in your app. This is one of the fundamental things to understand about NATIVE vs HTML. You've assembled a bit of a hybrid, a native app that's loading HTML. The fix: I can think of a few fixes, the best one will depend on the complexity of what you're trying to do. These ideas some to mind... --Use native media players and not embedded HTML media players. --Use javascript in the HTML to detect events in the HTML Dom to then act on. Like "turn off media" --Change the behavior of the back button so it doesn't just unload the current view but instead interacts with your embedded media. Probably using javascript? Most of the trouble with these ideas comes starts with app owners loading HTML they didn't write, control, or publish. When you don't have complete control over the HTML (and therefore cannot change it), it becomes challenging to try to figure out a solution. Can you freely post the URL to the HTML you're loading? I'de be interested in looking at the source (the HTML source) to see what may be happening.
 
buzzbt
Android Fan
Profile
Posts: 233
Reg: Nov 14, 2011
las vegas
6,530
like
09/09/12 04:19 AM (13 years ago)
Thank you David@buzztouch! Yes I am using embedded media you give me good ideas I will try to make it happen. Thanks!
 
buzzbt
Android Fan
Profile
Posts: 233
Reg: Nov 14, 2011
las vegas
6,530
like
09/13/12 06:11 AM (13 years ago)
Thank you David@buzztouch! I can't do it with out your help. I thankful for bt. Her what I am using embedded media . <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <title> Ethiopian Tv Live streaming (ERTA)</title> <head> ETV live <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Ethiopian Tv Live! (ERTA)</title> <div id="Playerholder"> <noscript> You need to have the <a href="http://www.macromedia.com/go/getflashplayer">Flash Player</a> installed and a browser with JavaScript support. </noscript> <object type="application/x-shockwave-flash" name="StrobeMediaPlayback" data="http://www.etvlive.gov.et/StrobeMediaPlayback.swf" width="300" height="291" id="player" style="visibility: visible"> <param name="allowFullScreen" value="true"> <param name="flashvars" value="id=1&src=rtmp://213.55.98.102/live/livestream&autoPlay=false&width=466&height=301&autoHideControlBar=false&controlBarPosition=over"></object> </div> <body> <table width="100%" border="0" cellspacing="5"> </table> <body bgcolor="#0099FF"><center> <div > <div id="Header"></div> <div id="Body"> <div id="LeftBody"> <div id="pic1"></div> <div id="pic2"></div> <div id="pic3"></div> </div> <div id="BodyCenter"> <div id="flashn"><br> <table width="100%" border="0" cellspacing="5"> <tr> <td> <div id="player"> <p> </p> </div> </td> </tr> </table> </div> </div> <div id="RightCenter"> <div id="pic4"></div> <div id="pic5"></div> <div id="pic6"></div> </div> <div id="footer"></div> </div> </div> </center> </body> </html>
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.