Closing a web page in a samsung smart

I have a samsung app that is currently streaming video via an IP camera.

So, I created an application that opens a web page when I click on a certain button (up arrow).

Up arrow related code:

var myWindow = window.open("http://10.0.0.164/mjpg/video.mjpg", "myWindow", "width=200, height=200");

Now the problem:

When the webpage opens, I can no longer control the application.

Is there no way for me to, for example, press the return key to close an open window and return to the application?

I tried to bind the command Window.close()

with other keys, but not sucess ...

Any ideas?

Thank you in advance!

Pedro

+3


source to share


2 answers


Yes, it launches the TV web launcher. I think you can try this.

Add this to HTML -

<div id="webElement" style="display:none;"></div>

      

On clicking the up button, try adding an object tag to show the url (specify the width and height you want.)

var webElement = jQuery("#webElement");  
webElement.empty();  
var obj = "<object type='text/html' width='1920' height='1080' data='" + urlToShow + "' onerror='Player.onWebElementError();'> </object>";  
webElement.append(obj);  
webElement.show();  

      

Click the button on the button, you can hide the div and return to the app.



var webElement = jQuery("#webElement");  
webElement.empty();  
jQuery("#webElement").hide();  

      

Hope this helps you a little.

Updated:

Add this to your project if JQuery is missing.

<script type="text/javascript" language="javascript" src="app/javascript/jquery-2.1.1.min.js"></script>

      

Check this url for more information:
http://jquery.com/

+1


source


The solution was simple: I was using an image block from app platform 2.0 and I set the IP camera url as the src of the image.



0


source







All Articles