!7 module DownloadAndPlayVideo { S url = "https://www.youtube.com/watch?v=XTN0Z60_k00"; visualize { ret centerAndEast( withLabel("Video URL to download: ", onEnter(rThread doIt, dm_fieldTextField('url))), jbutton("Download", rThread doIt)); } void doIt enter { temp dm_tempDisableAllButtons(); if (!validYouTubeID(extractYouTubeID(url))) ret with infoBox("That's not a valid YouTube URL: " + url); File f = dm_youTubeVideoDownloadToDir(url, downloadsDir("YouTube")); if (f == null) ret with infoBox("Couldn't download?"); infoBox("Playing video..."); dm_callModule(dm_makeOrShowModule("#1019320/VLCJTest"), 'playVideo, f); } }