The discourse mp4 player is ugly, I was thinking about how to improve it and found this, which seems quite simple. The configuration method is also relatively simple, just need to include the css and js.
The MP4 player of Discourse is egregiously unappealing. In my contemplation and exploration to ameliorate it, I stumbled upon this alternative. It exudes a certain minimalistic charm, and its setup methodology is fairly straightforward. Inclusion of the respective CSS and JS does the trick.
The content in the main text is incorrect and will cause bugs. When loading from the homepage, the player will not work. Below is what I paid $50 for someone to help me modify, shared for free with those in need. The player effect is very good and worth recommending!
Pros:
The color tone is quite matching
The player adapts to the screen from the beginning, rather than from small to large
More features
IMHO this is very bad code, awful.
It will run a function every 10 milliseconds that will not work 99% of the time, which is a huge waste of performance.
Sure, a home computer could support the expense… but it’s just so inelegant
你应该使用discourse的API来完成这项工作。使用这个:
You should use discourse’s API to do this. use this:
<script type="text/discourse-plugin" version="0.8">
api.onPageChange(() => {
if (document.querySelector("video")) {
new Plyr('video');
}
});
</script>
It’s fine, this is just a small gesture. We can talk about more challenging work next time.
(Of course, this doesn’t mean this job is very simple… you have to spend a lot of time reading enough discourse source code to quickly react to which API to call. And if you don’t pay, very few people will really spend time caring about what you want to achieve.)