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
source to share
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/
source to share