fixed components; added playerapp example
This commit is contained in:
parent
5d71662617
commit
a9b12a231f
5 changed files with 99 additions and 6 deletions
24
examples/mediaplayer/playerapp.nim
Normal file
24
examples/mediaplayer/playerapp.nim
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
## Example app that shows how to write and embed a custom component.
|
||||
|
||||
include karaxprelude
|
||||
import mediaplayer
|
||||
|
||||
const url = "https://www.w3schools.com/html/mov_bbb.mp4"
|
||||
|
||||
proc createDom(): VNode =
|
||||
result = buildHtml(table):
|
||||
tr:
|
||||
td:
|
||||
mplayer("vid1", url)
|
||||
td:
|
||||
mplayer("vid2", url)
|
||||
tr:
|
||||
td:
|
||||
mplayer("vid3", url)
|
||||
td:
|
||||
mplayer("vid4", url)
|
||||
|
||||
setRenderer createDom
|
||||
|
||||
proc onload() {.exportc.} =
|
||||
init()
|
||||
Loading…
Add table
Add a link
Reference in a new issue