0

I want to "hide" real ID of the video I am using on my website. I was thinking that I can somehow encrypt the ID before using it in html source code and then encrypt it back to normal in plyr. My knowledge is not good enough to find the right place where I can do that in the plyr.js file

Could someone help me?

I can see only one occurence of the string in the souce code

// Embed attributes
attributes: {
  embed: {
    provider: 'data-plyr-provider',
    id: 'data-plyr-embed-id'
  }
},

but have no idea how do track the right place where I can modify the value.

It would help me if you could write how you found the right place. I was helped how to modify data-plyr-provider but was given the fish. So still looking how to fish

Radek
  • 13,813
  • 52
  • 161
  • 255

1 Answers1

1

Warning: this answer may become outdated as the source changes. Find the references to embed.id in

youtube.js

and

vimeo.js

and add e.g. decryption (assuming you encrypt the id in the div)

https://github.com/sampotts/plyr/search?q=embed.id

The lines are:

// Get from <div> if needed
if (is.empty(source)) {
  source = player.media.getAttribute(this.config.attributes.embed.id);
}

Change this to e.g.:

// Get from <div> if needed
if (is.empty(source)) {
   source = player.media.getAttribute(this.config.attributes.embed.id);
   source = decrypt(source);
}

But note that this is still not very secure, as the player will need to know the actual id at some point, and it has to be plain text. This only obfuscates the value in your HTML source. The ID will also be discernible from analyzing the requests the player makes to Youtube/Vimeo.

dssjoblom
  • 124
  • 1
  • 4