Module:Panopto: Difference between revisions
m Protected "Module:Panopto" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
m 1 revision imported |
(No difference)
| |
Latest revision as of 13:21, 6 May 2026
Module:Panopto provides utility functions for parsing Panopto URLs and extracting video UUIDs. It accepts any Panopto URL containing a UUID in the standard 8-4-4-4-12 hexadecimal format.
Usage
{{#invoke:Panopto|extractUUID|URL}}
Example
{{#invoke:Panopto|extractUUID|https://swarthmore.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=12345678-abcd-efgh-ijkl-mnopqrstuvwx}}
Returns: 12345678-abcd-efgh-ijkl-mnopqrstuvwx
If no UUID is found in the provided input, the module returns No UUID found.
Notes
- The module is case-insensitive — UUIDs in uppercase or mixed case will be normalised to lowercase
- The URL parameter can be passed as a named parameter (
url=) or as the first unnamed parameter
See also
- Widget:Panopto — embeds a Panopto video using a UUID returned by this module
Extension:Scribunto— required for Lua modules
local p = {}
function p.extractUUID(frame)
local url = (frame.args.url or frame.args[1] or ""):lower()
-- Pattern to match a UUID (8-4-4-4-12 hex format)
local uuid = url:match(
"(%x%x%x%x%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%-%x%x%x%x%x%x%x%x%x%x%x%x)"
)
return uuid or "No UUID found"
end
return p