Peeyushpd
Peeyushpd

Reputation: 69

Java script to block video streaming on the webpage

I want to write a javascript which will be just put at the end of HTML pages and it should block the video streaming if its being done on those webpages. Considering "embed" tag is used at many places, I tried writing below script which will link it to some webpage which has a jpeg image saying "Blocked Content" or something like that.

var embeds = document.getElementsByTagName("embed"); 
for(var i = 0; i < embeds.length; i++){
   if(embeds[i].type == "application/x-shockwave-flash"){
       embeds[i].type = "image/jpeg"
       embeds[i].src = "Some link to a jpeg image on the web"           
       embeds[i].flashvars = {}
   }
}

One of the websites I tried putting this script has used "swfobject.embedSWF" to stream videos, which also has flashvars variable set. So I am also trying to reset the flashvars here. But its not working. Can anyone please suggest how can I do this ?

Upvotes: 0

Views: 611

Answers (0)

Related Questions