In our app, we allow people to embed videos using iframe
or script
tags. But we dont want to allow the people watching the video to easily copy these embed codes and post them elsewhere.
For iframes - what we've done is, in the iframe
tag, we replace the src
attribute's value with a proxy URL we have setup inside our application which simply redirects to the actual src
URL. Besides this, it also does the authentication at this stage.
Clever people will surely be able to crack this, but this seems like a good solution for most cases since when they try to inspect the dom they only see the proxy URL and not the actual one.
For < script/> - I tried doing the same, but did not work out. Eg. -
<div id="wowza_player"><script src='//player.cloud.wowza.com/hosted/abcdefg/wowza.js' type='text/javascript'></script></div>
Is there anyway to obfuscate or prevent abuse of these embed codes?
Thanks!