dgryski / gophervids

Proof of concept Gopher Video player
http://gophervids.appspot.com/
50 stars 26 forks source link

Reorganization of code and move to HTML5 api #16

Closed campoy closed 10 years ago

mholt commented 10 years ago

What about moving the video list into a JSON file?

dgryski commented 10 years ago

I'm going to merge this by hand, but in a few smaller chunks: first just the patch for the HTML5 player, then the large patch splitting out the javascript. I'm also going to keep it on the Go runtime for now.

If I move the video list into the code, then RSS support ( https://github.com/dgryski/gophervids/issues/11 -- an oft requested feature) becomes easier.

campoy commented 10 years ago

Some advice: use JSHint and some kind of prettifier. That way it will feel "almost" like writing Go with gofmt :)

dgryski commented 10 years ago

Ug, cross-origin javascript security blah blah blah. This is probably why I went with the flash stuff in the first place :(

campoy commented 10 years ago

What is the problem you're seeing exactly?

dgryski commented 10 years ago

Testing on my digital ocean box, serving up the index.html over https and setting Access-Control-Allow-Origin, but Chrome tells me:

Uncaught SecurityError: Blocked a frame with origin "https://www.youtube.com" from accessing a frame with origin "https://<snipped>:8080". Protocols, domains, and ports must match.

Also, it seems like it has to be served over https since youtube wants to serve stuff to Chrome over https. Chrome will probably talk to appengine over https, but I'm not sure about FF, Opera, etc..

campoy commented 10 years ago

I can't reproduce it on App Engine :-/

http://vids.campoy-personal.appspot.com/

dgryski commented 10 years ago

Solved. I missed that there were changes to the javascript above and beyond just ripping it out of the html file.

dgryski commented 10 years ago

Ok, I think I've merged all the bits of this.

Thanks for your help!