components
All repositories: gitoria
1.8 KB
// demo.hl — `/media-player`: the player on a page, with how to use it. The page owns the queue and hands the player its src// back when a queue item is tapped (the host decides what plays; the component only tells it).parent '../main.hl'import MediaPlayer from './media-player.hl'__title = 'Media player · Hybriel components'// the demo's queue: the item that plays says so by its src (the player marks it current); the lengths are the files' ownHybrid items = [{ src = '/media/test-video.mp4' title = 'Test clip (video)' dur = '0:30' }{ src = '/media/test-audio.mp3' title = 'Test tone (audio)' dur = '0:45' }{ src = '/media/test-video.mp4?again' title = 'Test clip again (video)' dur = '0:30' }{ src = '/media/test-audio.mp3?plain' title = 'Test tone without a cover (audio)' dur = '0:45' }]String current = '/media/test-video.mp4'String currentKind = 'video'String autoPlay = 'false'String currentTitle = 'Test clip (video)'String currentArtist = 'made with ffmpeg (public domain)'String currentCover = '/media/cover.png'picked = (src) => {current = srcautoPlay = 'true'let i = 0while (i < items.length) {if (items[i].src == src) { currentTitle = items[i].title }i = i + 1}currentCover = src.endsWith('?plain') ? '' : '/media/cover.png'currentKind = src.endsWith('.mp3') || src.endsWith('?plain') ? 'audio' : 'video'}View {mediaPlayerDemo {h1 { "Media player" }p { class = "muted" "Video and audio in one phone-first player: a seek bar you drag with a finger, back and forward 10 seconds, play and pause, mute, the speed and fullscreen (video). The queue under it plays the next item when one ends." }MediaPlayer { src = current kind = currentKind title = currentTitle artist = currentArtist cover = currentCover queue = items onPlay = picked autoPlay = autoPlay }p { a { id = "readme" href = "/media-player/README.md" "README (how to use it)" } }}}
Branches
Latest commits
- bd4aa808Record VL24 deployment and live verificationmre
- e5b98ecfRun virtual-list gate before deploymentmre
- 2e9b4a8evirtual-list: into main, with centerId and scrollTop/onScroll (jukebox#20)mre
- 69954249Align all plugin sources with Hybriel day38bmre
- f740f666Re-vendor components to Hybriel set day38bmre
- 8176eb14Record CS23b deployment and live verificationmre
- 84e3ddaaRemove blank line before pagination Style closing bracemre
- a92298ddRecord exact CSS and same-date proof after specificity reviewmre
- c71a0abePreserve consumer theme specificity with nested tag rulesmre
- 64a2bc27Document CS23b style formatting proof and review statusmre
- a72b57cficons: nest Style rules in the language's formmre
- 927616e2pagination: nest Style rules in the language's formmre
- aab8ad29code-editor: nest Style rules in the language's formmre
- ba30727afile-upload: nest Style rules in the language's formmre
- 42fefa4emodal: nest Style rules in the language's formmre
- 6fd953e3range-picker: nest Style rules in the language's formmre
- f661951ddate-picker: nest Style rules in the language's formmre
- 363577e6media-player: nest Style rules in the language's formmre
- 0b3fd8c9comments: nest Style rules in the language's formmre
- 67e043c8plugins/web/README.md from hybriel cb9e480dmre