-
-
Save boserup/ed78b7b0c10c983422e895be7623a82d to your computer and use it in GitHub Desktop.
Widget which opens the Apple Event Stream on YouTube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let widget = new ListWidget() | |
widget.setPadding(0,0,0,0) | |
widget.url = "https://p-events-delivery.akamaized.net/1108byjxmnoakagswdphbwatymztxxew/m3u8/main.m3u8" | |
widget.backgroundColor = new Color("#FFFFFF") | |
await loadImage("https://cdn.vertexreport.com/wp-content/uploads/2020/09/Apple-Event-September.jpg") | |
Script.setWidget(widget) | |
Script.complete() | |
// download and display the cover | |
async function loadImage(imageUrl) { | |
let req = new Request(imageUrl) | |
let image = await req.loadImage() | |
let widgetImage = widget.addImage(image) | |
widgetImage.imageSize = new Size(280,280) | |
widgetImage.centerAlignImage() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment