Question

I want to hide HTML Code from source code, how this is possible?

For example:

jwplayer("mediaplayer").setup({
        file: "http://example.com/Media.m3u8",
            autostart: 'true',
            controlbar: 'bottom',

file: "http://example.com/Media.m3u8", How can I hide the code?

Was it helpful?

Solution

You can't hide it, the best you could do is make it a little harder to figure it out. And this is just obscuring, it is NOT securing.

For the server side portion, you could change:

file: "http://example.com/Media.m3u8",

to

file: window.atob('<?php echo base64_encode("http://example.com/Media.m3u8");?>'),

and then the output will be:

    file: window.atob('aHR0cDovL2V4YW1wbGUuY29tL01lZGlhLm0zdTg='),

Just know, this won't stop anyone who really wants to figure it out. It will only stop someone who doesn't know anything about programming and is too lazy to spend five minutes on it.

OTHER TIPS

You can't. It has to be sent to the browser in order to be executed/viewed/played, and the user can always copy it.

You can not handle it, but on the other side, that the link you provided, you can manage the authentication

If your question is how to protect the link, you can use some server side code to generate a one time usable link generated each time the page is loaded that only allows access to that file one time. once that use is up the URL is now useless. But even this is able to be bypassed.

It is not possible to totally hide something. At the end of the day, if people want to take your content badly enough, they will figure out a way to do so.

However, if you want to use HLS AES encryption, or secure streaming via RTMPE, that will help. The JW Player supports both of these. Then you can also use some tools to encode/encrypt/obfuscate your code, however, people with any technical know how can easily decode/decrypt/deobfuscate this with other tools, or simply by using Firebug/Chrome developer tools. It will make it harder for some of your audience to take your videos, though, but not all. But people will still be able to figure out a way to do this if they want your content badly enough, they will even use screen recorders as a last resort. One other thing you should do is encode your videos with your own watermark if you are concerned about people screen recording your videos.

My idea would be to look into only allowing your site (domain name) to download it and encoding the link.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top