简体   繁体   English

关闭三星智能电视应用程序中的网页

[英]Closing a webpage in a samsung smart tv app

I have a samsung App that is currently streaming a video through a IP camera. 我有一个三星应用程序,目前通过IP摄像头流式传输视频。

So, I made a app that opens a webpage when I click a certain button (Up arrow). 所以,当我点击某个按钮(向上箭头)时,我创建了一个打开网页的应用程序。

The code associated to the up arrow is : 与向上箭头关联的代码是:

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 don't have any control of the app anymore. 当网页打开时,我对该应用程序不再有任何控制权。

Isn't there a way for me , for example, press the return key to close the the opened window and go back to the app? 对我来说没有办法,例如,按返回键关闭打开的窗口并返回应用程序?

I tryed associating the command Window.close() to other keys, but no sucess... 我尝试将命令Window.close()与其他键相关联,但没有成功...

Any ideias? 任何想法?

thank you in advance! 先感谢您!

Pedro 佩德罗

Yes it is launching the web url launcher of the TV. 是的,它正在启动电视的网址发射器。 I think you can try this. 我想你可以尝试一下。

Add this in HTML- 在HTML-中添加

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

On button up click, try adding the object tag to show the URL (set width and height which you want.) 在按钮上单击,尝试添加对象标记以显示URL(设置所需的宽度和高度。)

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();  

On button back click , you can hide the div and return back to application. 在按钮上单击后 ,您可以隐藏div并返回到应用程序。

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

Hope it will help you a little bit. 希望它会帮助你一点点。

Updated: 更新:

Add this in your project if JQuery is missing. 如果缺少JQuery,请在项目中添加它。

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

Check this URL for more info: 查看此URL以获取更多信息:
http://jquery.com/ http://jquery.com/

解决方案很简单:我使用了app framework 2.0中的图像块,并将IP摄像机的URL设置为图像的src。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM