
This is not instant, as HTTP queries used for majority of services take their time, but querying for metadata is pretty cheap as long as you don't do it in a Think hook or similar. more than two cannot play simultaneously.īoth server and client have the ability to query for video metadata. If there can be arbitrary amount of player controlled jukeboxes on the map, you might want to add some limitations so eg. In a nutshell you should use mp3 or ogg files when possible, as they are way cheaper for media playback, but for things like media players that must accept Youtube links HTML media works fine. There should be no problem having many of them playing at the same time if needed. HTML panels are relatively expensive way to playback videos, but having one or two of them should work fine.īASS sound objects (which are used for webaudio and webradio) are pretty cheap. On clientside medialib uses either HTML Awesomium panels or BASS sound objects for playback. This means that to for example synchronize video between clients, you must handle networking the media URL and the media start time yourself.įor this purpose you might find my NetTable library useful, but medialib itself contains no networking code. Medialib provides no means of communication between server and client.

See examples/ for more elaborate examples. SimpleText(timeStr, "DermaDefaultBold ", w - 5, h + 3, Color( 0, 0, 0), TEXT_ALIGN_RIGHT) Local timeStr = string.format( "%.1f / %.1f ", mediaclip: getTime(), duration)ĭraw. SimpleText(title, "DermaDefaultBold ", 5, h + 3, Color( 0, 0, 0))

Local title, duration = tostring(meta and meta. You should use Service#query on serverside. Note: this is a clientside shortcut to Service#query. 'meta' will be nil if metadata is still being fetched. Add( "HUDPaint ", "DrawVideo ", function()

Store global reference for debugging purposes Create a mediaclip from the link local mediaclip = service: load(link) youtube, twitch, vimeo, webaudio) local service = medialib. If existing global reference exists, remove them if IsValid(CLIP) then CLIP: stop() end local link = " " - Get the service that this link uses (eg.
