Geraldlzc look, you're hacking away at an extension then report an issue without mentioning this change?
Your approach is wrong. You can't inject javascript into the page through that upload template, the remote javascript that renders the link needs to be injected into Flarum once; with the template it gets added on every upload.
You should create a local extender that injects the remote javascript and then additional changes are needed based on how that videojs script works.