From 0c2bb7d5aa89cac4e0e7301a31ae1fdb89b6be5e Mon Sep 17 00:00:00 2001 From: Ylva Selling Date: Fri, 14 Apr 2023 18:05:08 -0400 Subject: [PATCH] Add example asset for stretching video --- .../examples/videostretchedtotime.asset | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 data/assets/examples/videostretchedtotime.asset diff --git a/data/assets/examples/videostretchedtotime.asset b/data/assets/examples/videostretchedtotime.asset new file mode 100644 index 0000000000..5a64a9711c --- /dev/null +++ b/data/assets/examples/videostretchedtotime.asset @@ -0,0 +1,39 @@ +local earth = asset.require("scene/solarsystem/planets/earth/earth") + +local data = asset.syncedResource({ + Name = "Example Globe Video", + Type = "UrlSynchronization", + Identifier = "example_globe_video", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" +}) + +local spec = { + Identifier = "TestVideo", + Video = data .. "/test-video.mp4", + StartTime = '2023 01 29 20:00:00', + EndTime = '2023 01 29 21:00:00', + Name = "Test Video", + PlaybackMode = "MapToSimulationTime", + Enabled = asset.enabled, + Type = "VideoTileLayer", + Description = [[Video stretched to time]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(earth.Earth.Identifier, "ColorLayers", spec) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(earth.Earth.Identifier, "ColorLayers", spec) +end) + +asset.export(spec) + +asset.meta = { + Name = "Video Stretched To Time", + Version = "1.1", + Description = "This is a video mapped to the simulation time in OpenSpace.", + Author = "OpenSpace Team", + URL = "https://openspaceproject.com", + License = "MIT" +}