Christian Meixner Posted November 10, 2023 Posted November 10, 2023 Chrome offer a convenient "Dowload" Button in its native HTML5 video player's context menu, that I want to be disabled. (Sorry, german screenshot. The marked button means "Download"). This button can be disabled by adding the following HTML attribute to the video tag: controlsList="nodownload" In AdminCP theme editing there is a template file wich looks exactly like the embedded video player code: Unfortunately making any changes there will not apply to the actual embedded video player code. So this must be generated from another part of the Invision application. I'd appreciate any help on how to get that controlsList="nodownload" Attribute applied to the video tag that Invision renders in the posts. Thanks!
Daniel F Posted November 10, 2023 Posted November 10, 2023 The template is attached to the post, so if you make any changes to the template, they won't be retroactive, but any new video should contain the new code. Christian Meixner 1
Christian Meixner Posted November 10, 2023 Author Posted November 10, 2023 Hmm, I tried that, but it did not work. Just for the test I created a new theme as a copied from unmodified default theme. Then I edited only the template file shown in the screen from the post above, selected that new theme in frontend, created a new post with a video attached. But the code used to embed the video in this post was still the same (like unmodified default template file).
Nathan Explosion Posted November 10, 2023 Posted November 10, 2023 (edited) 2 hours ago, Daniel F said: The template is attached to the post, so if you make any changes to the template, they won't be retroactive, but any new video should contain the new code. Away from my PC right now but I seem to recall that the html template only gets used if the user doesn't click the uploaded video. I think there's a hard-coded <video> element in one of the editor JS files which is used when the user does click the uploaded video to add it to the editor themselves. Back at PC in 10 minutes, will check then - happy to be wrong on this one though. Edited November 10, 2023 by Nathan Explosion Daniel F 1
opentype Posted November 10, 2023 Posted November 10, 2023 That’s my guess as well. There is a different between “attached” (at the end) and “attached and moved into the content”.
Nathan Explosion Posted November 10, 2023 Posted November 10, 2023 (edited) Yup...ips.editor.insertable.js That is used when the user chooses to click the video to add it. The template is used when the user doesn't add the video themselves - screenshot below is the code of a submitted post, where 2 videos were attached, but only one was clicked on to add it and the other was added via post submission: Edited November 10, 2023 by Nathan Explosion Christian Meixner and Daniel F 2
Christian Meixner Posted November 13, 2023 Author Posted November 13, 2023 Thanks for having a look into this. So does this mean that there is no chance to modify the video player template with tools provided by the platform itself? We use the cloud version of Invision. So manipulating platform source files seems not an option.
Nathan Explosion Posted November 13, 2023 Posted November 13, 2023 (edited) 17 minutes ago, Christian Meixner said: So does this mean that there is no chance to modify the video player template with tools provided by the platform itself? Correct - to affect a video that has been added by a user clicking the uploaded file to add it to the editor, you would need to modify a JS file (and even then, it's not a file but a row in the database...and you don't have access to that, and it would be updated on every upgrade anyway) There are other ways to apply it but it requires a plugin/application to do it. I've got it as a feature in https://www.ynwa.tv/files/file/38-ne-html5-audiovideo-player/ but that would be hitting a small nail with a very large hammer if your requirement is simply to add that controlslist. Edited November 13, 2023 by Nathan Explosion
Recommended Posts