2

One problem that I am facing with chromecast is that it doesn't cache the content it downloads. I want to show the same video in a loop, but with chromecast the video needs to be downloaded every time when it needs to be shown. Is it possible to achieve this with chromecas without having to store the videos in a local machine(PC) first. Is i possible for chromecast to write videos in usb device attached to the TV. Maybe you can suggest some other solution(technology) for this problem?

Thank you

1 Answers1

3

It is possible to use the Media Source Extensions to loop the video. You have to download the video data into an ArrayBuffer and then write JavaScript logic to detect the end of the loop and then reset the media element playback position to the beginning of the video. The video needs to have the header (moov box) before the data (mdat box). You can use a utility like MP4Box to convert the video in the right format.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • @DavidPetkov Can you post a code snippet of your javascript on pastebin? I am trying to do the same thing and i'm not able to get it to work. – Pierre-Luc Champigny Jul 25 '14 at 20:32
  • I've published a sample receiver: https://github.com/googlecast/CastVideoLooping-receiver – Leon Nicholls Aug 02 '14 at 13:54
  • @LeonNicholls Thank you Leon, I tried your sample, but it crashes the chromecast on file over 32MB. I've asked a question about this problem: http://stackoverflow.com/questions/25003269/storing-large-file-in-chromecast-memory – Pierre-Luc Champigny Aug 08 '14 at 00:13
  • For larger video files that won't fit into memory you will have to use a streaming solution to read the segments one at a time. – Leon Nicholls Aug 09 '14 at 20:38