I'm building an instant YouTube client in ClojureScript and Reagent, it's currently live at http://instatube.net/ when I try to play most music videos, it displays the error "the video contains content from X. it is restricted from playback on certain sites", yet the same video plays just fine on my local server, the iframe sends the same referer and origin headers in both cases, it also works when I embed the video here https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default I don't understand what the issue is, this is my iframe reagent component
[:iframe {:class "embed-responsive-item"
:allow-full-screen "allowfullscreen"
:frame-border 0
:auto-play 1
:src (str "https://www.youtube.com/embed/" (if (nil? videoId)
"SW-BU6keEUw" videoId) "?autoplay=1&enablejsapi=1")}]]
and this is the ajax request I'm sending to the YouTube search API v3 using cljs-ajax
(fn [term]
(ajax/GET
"https://www.googleapis.com/youtube/v3/search"
{:params {:q term
:maxResults 5
:part "snippet"
:type "video,playlist"
:key YOUTUBE_API_KEY}
:handler handle-youtube-resonse
:response-format (ajax/json-response-format {:keywords? true})
:headers {:referer "https://www.youtube.com/"
:x-spf-referer "https://www.youtube.com/"}))