Setting up Apple TV video JavaScript

烈酒焚心 提交于 2019-12-06 13:53:53

Your sample is ok and do work. Even with the constraint errors, but player is not very forgiving.

I think you're using the Python SimpleHTTPServer for your test, it did not worked for video streaming, but if you use Apache or for example this file directly from apple "http://trailers.apple.com/movies/focus_features/9/9-clip_480p.mov" it will work.

I had the same problem. It turns out that Python's SimpleHTTPServer is not capable of streaming out video and is a poor (minimalist) example to use. I went with http-server instead and it works flawlessly. This is the syntax I used (on my Mac):

$ npm install http-server -g
$ http-server ./ -p 9001 -a 192.168.16.105

where:

./ is the path to the root of the web server

-p 9001 is the port you want to use

-a 192.168.16.105 is the IP address you want to serve from

You can check that it works correctly by opening a web browser and doing something like:

http://192.168.16.105:9001/myvideo.mp4

(just make sure you have a video file in that folder to play)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!