varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.41k stars 64 forks source link

Add example for using video tag in a Kobweb site #334

Open Micoder-dev opened 9 months ago

Micoder-dev commented 9 months ago

Need a proper doc for Video Tag which is used in HTML that plays all types of videos, here we have a Video attr but don't know how to implement


bitspittle commented 9 months ago

Thank you for filing this doc bug. I agree video is useful and can be documented.

For now, you can see me using it in action here: https://github.com/varabyte/kobweb-site/blob/2be6aaf838232240ace56d13290a691ec2a5194c/src/jsMain/kotlin/com/varabyte/kobweb/site/components/sections/home/CliSection.kt#L43

This is basically a case where you'll use raw Compose HTML. Hope the helps!

Micoder-dev commented 9 months ago

Thank you for filing this doc bug. I agree video is useful and can be documented.

For now, you can see me using it in action here: https://github.com/varabyte/kobweb-site/blob/2be6aaf838232240ace56d13290a691ec2a5194c/src/jsMain/kotlin/com/varabyte/kobweb/site/components/sections/home/CliSection.kt#L43

This is basically a case where you'll use raw Compose HTML. Hope the helps!

We can play local videos with this code, but what if we have online URLs like HLS

bitspittle commented 9 months ago

I'm not sure exactly what you mean by the last part, but I'm pretty sure that solving and/or documenting that case is outside the scope of Kobweb.

Anytime I need to support a new feature, I search for how to do it in basic HTML / JS first. And from there it is usually straightforward to convert it to Kotlin.