7

I have to develop a Samsung TV application to play videos that are served from a remote server, which I don't have access to.

Actually I've made an application to play videos of my own server. But my current requirements are as follows:

  1. I want to play videos that are served from a remote host (say //remote.com/video_id) to which I have no access, but my TV application is connected to my server (say //myserver.com/samsungapp)
  2. I have to cache file on my Samsung TV before playing. ie., buffer 100% and then play

I've checked FileApi and FileReader using HTML5 and JS, and come up with following barriers:

Its difficult to send cross domain request from Javascript. Since I don't have access to remote host, I can't set access-control-origin on the remote server's response.

Any suggestions are appreciated...

4

1 回答 1

3

有修改缓冲区大小的方法:SetTotalBufferSize

但是您不能缓冲 100% 的视频,因为它只会耗尽电视的 RAM 内存。

因此,您有事件来检查缓冲是否完成:OnBufferingComplete

我不知道您的任务的目的是什么,但您可以将整个文件下载到设备而不是缓冲它。

这是方法: http: //www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_2.5/API_Reference/JavaScript_APIs/SEF_Plugin_API/Download

因此,您可以下载电影并将其保存到设备中。然后从本地播放您的电影。

于 2012-07-28T06:20:15.327 回答