2

I'm using video.js in my project. What I'm trying to do is hide the video source from the html tag.

I've tried to set up the src from js code as following:

var videoPlayer = videojs("videoPlayerLive", {
    "controls": true,
    "autoplay": false,
    "preload": "none",
});

videoPlayer.src('some url');

Still I can find the src in the video tag if I check the video player element from Chrome. (From Chrome, right click the video player and select Inspect, I can find the html element with the src there.)

Does anybody know how to hide this src attribute from the html?

Any suggestion will be highly appreciated.

6
  • You could make it more difficult to retrieve the source by using a javascript obfuscation tool. Commented Feb 14, 2017 at 8:14
  • @CeilingGecko Hi thanx for your suggestion. But what I'm trying to do here is to hide the src='some url' from the html. Commented Feb 14, 2017 at 8:18
  • Well, you cant hide it, there are just some tweaks you can do to make it more difficult to inspect the source. Commented Feb 14, 2017 at 8:25
  • There are ways to hide the attribute, but one will still be able to open its console's Network Panel and see from where it comes. Or even, to read your js. So all in all, it's a no-go. Commented Feb 14, 2017 at 9:12
  • @Kaiido Thank you. I understand it's impossible to completely hide the source. I only want to hide the attribute, so will give the page a little bit protection. You mentioned there are ways to do this. I tried your code, but it not work. Would you please share more explanation? Many thanx. Commented Feb 14, 2017 at 9:41

1 Answer 1

1

You can't. Inspect will show the whole content including dynamically loaded.

What you see in the browser can be seen by inspecting. Where as view-source show only static content. You can uglify the js source code to prevent users from viewing the url. But still they can get it by using getAttribute in the console.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.