TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: HTML5 Video Player in TypeScript

151 pointsby matvpover 6 years ago

13 comments

Ambroosover 6 years ago
Some extra background: I worked on a predecessor of this with Matthias about two years back. We had to build a web video player with a lot of advanced capabilities, and found that no open source or commercial player framework would give us what we needed as developers to deliver something really good. I&#x27;ve since moved abroad and haven&#x27;t been involved with this directly.<p>A lot of the ideas we came up with made it into this project, and what Matthias did differently in this iteration (like adding Typescript and improving how you write extensions) look really good. You can consider this to be an alternative to video.js, for example, but with easier ways to build advanced extensions without having to fall back to pretty oldschool ways of doing JS.<p>Matthias&#x27; default UI for example is built in React, but there&#x27;s nothing stopping you from not using his UI extension and building your own that works however you want. Because of the heavy use of Webpack bundle splitting, if you don&#x27;t use the built-in UI React won&#x27;t even be loaded, and that approach is core to how this is designed.
评论 #18939623 未加载
mig4ngover 6 years ago
Amazing job, I have a few suggestions on how to improve its UX:<p>- Clicking the video should pause&#x2F;play;<p>- Clicking the volume button on mobile when the volume bar is hidden should not mute the video, instead it should just show the volume bar;<p>- Interacting with the volume UI on mobile should reset the time until the UI hides, the UI hides while I&#x27;m ajusting the volume.<p>These are a few points I think should be improved, I&#x27;d love to hear others opinions on whether or not these make sense :)<p>Keep the great work!
评论 #18939576 未加载
btbuildemover 6 years ago
How is this preferable to using the &lt;video&gt; tag?
评论 #18939478 未加载
评论 #18939466 未加载
评论 #18940094 未加载
andyidsingaover 6 years ago
Thanks - I&#x27;ve been using &quot;Plyr&quot; [0] for some personal video projects. Interesting to compare features and see this one done in TS.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;sampotts&#x2F;plyr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sampotts&#x2F;plyr</a>
melcorover 6 years ago
Looks pretty good, at first glance I miss the functionality to pause&#x2F;un-pause by clicking on the video. I believe this is a pretty common functionality that you should consider implementing.
评论 #18939400 未加载
hawskiover 6 years ago
One thing that I would love to have on mobile is an adaptive (?) video seeking. So you touch the &quot;video cursor&quot; and then move: the x axis is for seeking, but y axis is for sensitivity. Moving a finger along the bar (y = 0) is as things are currently - go to the right edge to seek till the end of the video. However moving it along the top edge of the video (y = 720) would only seek in terms of 5 seconds for example.<p>The scale between y=0 and y=720 wouldn&#x27;t have to be linear.
评论 #18940184 未加载
评论 #18940285 未加载
评论 #18940185 未加载
kohanzover 6 years ago
Nice work! As someone that uses <a href="https:&#x2F;&#x2F;github.com&#x2F;sampotts&#x2F;plyr" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sampotts&#x2F;plyr</a> in one of my projects (and react-plyr), what are the main differences between the two players &amp; designs?
评论 #18941420 未加载
评论 #18940420 未加载
flixicover 6 years ago
Really nice UI. Simple, neutral and sharp.<p>In addition to other feedback in this thread, I&#x27;d also want the Volume icon to change: show muted state &#x2F; volume level state without showing the slider. YouTube does this well.
评论 #18941198 未加载
评论 #18943372 未加载
VikingCoderover 6 years ago
Your example doesn&#x27;t actually have an element with id &quot;player&quot; in it, even though you getElementById(&#x27;player&#x27;). Is that a broken example, or am I missing something?
评论 #18939512 未加载
coldeover 6 years ago
Why not use something like video.js which already has a number of pluggable backend and third party plugins supported. Just for the lack of TypeScript?
评论 #18939627 未加载
elcometover 6 years ago
Does it support subtitles ? I&#x27;ve been looking for a video player that supports uploading subtitles, or loading then from a url
评论 #18943213 未加载
vernieover 6 years ago
When will we move on from Big Buck Bunny?
评论 #18942297 未加载
danabramsover 6 years ago
really awesome.