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...

Michael Gaskill
  • 7,913
  • 10
  • 38
  • 43
rajukoyilandy
  • 5,341
  • 2
  • 20
  • 31
  • 1
    Perhaps you could clarify what your actual question is? – Phrogz Jul 27 '12 at 05:19
  • 2
    @Phrogz I want to cache the video file somehow fully, before playing started – rajukoyilandy Jul 27 '12 at 05:21
  • 1
    This may be of help: [Using Script tags to do remote HTTP calls in Javascript](http://jaybyjayfresh.com/2007/09/17/using-script-tags-to-do-remote-http-calls-in-javascript/) – Jomoos Jul 27 '12 at 06:07

1 Answers1

3

There is method for modifying buffer size: SetTotalBufferSize

But you can't buffer 100% of your video as it simply runs out RAM memory of the TV.

Therefore you have event to check if buffering is complete: OnBufferingComplete

I don't know what is the purpose of your task, but you can download whole file to the device instead of buffering it.

Here is the method: http://www.samsungdforum.com/Guide/View/Developer_Documentation/Samsung_SmartTV_Developer_Documentation_2.5/API_Reference/JavaScript_APIs/SEF_Plugin_API/Download

So you can download movie and save it to the device. And after that play your movie from local.

Adam Lukaszczyk
  • 4,898
  • 3
  • 22
  • 22