Skip to content
Snippets Groups Projects
Commit e549230b authored by Lars Frost's avatar Lars Frost
Browse files

Merge branch 'main' into 'main'

Dirty fix for Moodle Update in Jan 2025

See merge request !3
parents 7a097581 9df71057
No related branches found
No related tags found
1 merge request!3Dirty fix for Moodle Update in Jan 2025
if (window.location.host === 'engage.streaming.rwth-aachen.de') { if (window.location.host === 'engage.streaming.rwth-aachen.de') {
if (!window.location.href.startsWith('https://engage.streaming.rwth-aachen.de/paella/ui/watch.html')) if (!window.location.href.startsWith('https://engage.streaming.rwth-aachen.de/paella/ui/watch.html') || !window.location.href.startsWith('https://engage.streaming.rwth-aachen.de//paella7/ui/watch.html'))
console.warn('looks like we are running outside a player context‽') console.warn('looks like we are running outside a player context‽')
const inFrame = (window.parent !== window) const inFrame = (window.parent !== window)
...@@ -8,7 +8,7 @@ if (window.location.host === 'engage.streaming.rwth-aachen.de') { ...@@ -8,7 +8,7 @@ if (window.location.host === 'engage.streaming.rwth-aachen.de') {
.then(d=>d.json()) .then(d=>d.json())
.then(meta => { .then(meta => {
window._meta = meta window._meta = meta
let videoTracks = meta['search-results'].result.mediapackage.media.track let videoTracks = meta['result'][0].mediapackage.media.track
.filter(t=> t.mimetype.startsWith('video/') && t.url.startsWith('http')) .filter(t=> t.mimetype.startsWith('video/') && t.url.startsWith('http'))
.sort((a,b) => .sort((a,b) =>
a.mimetype.localeCompare(b.mimetype) a.mimetype.localeCompare(b.mimetype)
...@@ -59,7 +59,7 @@ function genIdPrefix(videoId) { ...@@ -59,7 +59,7 @@ function genIdPrefix(videoId) {
} }
function genVideoContainerId(vidIdOrMeta) { function genVideoContainerId(vidIdOrMeta) {
if (typeof vidIdOrMeta === 'object') if (typeof vidIdOrMeta === 'object')
vidIdOrMeta = vidIdOrMeta['search-results'].result.id vidIdOrMeta = vidIdOrMeta['result'][0].id
return `${genIdPrefix(vidIdOrMeta)}_container` return `${genIdPrefix(vidIdOrMeta)}_container`
} }
...@@ -77,7 +77,7 @@ const FMT = (()=>{ ...@@ -77,7 +77,7 @@ const FMT = (()=>{
})() })()
function genLinkList(tracks, meta) { function genLinkList(tracks, meta) {
let videoTitle = meta['search-results'].result.dcTitle || '?' let videoTitle = meta['result'][0].dc.title[0] || '?'
let videoLinkList = document.createElement('ul') let videoLinkList = document.createElement('ul')
videoLinkList.classList.add('videoLinkList') videoLinkList.classList.add('videoLinkList')
tracks.forEach(track => { tracks.forEach(track => {
...@@ -100,7 +100,7 @@ Audio: ${mAud.channels}ch@${FMT.hz(mAud.samplingrate)} (${FMT.bps(mAud.bitrate)} ...@@ -100,7 +100,7 @@ Audio: ${mAud.channels}ch@${FMT.hz(mAud.samplingrate)} (${FMT.bps(mAud.bitrate)}
} }
function genLinkContainer(tracks, meta) { function genLinkContainer(tracks, meta) {
let videoTitle = meta['search-results'].result.dcTitle || '?' let videoTitle = meta['result'][0].dc.title[0] || '?'
let details = document.createElement('details') let details = document.createElement('details')
details.id = genVideoContainerId(meta) details.id = genVideoContainerId(meta)
details.classList.add('_ext-openExcellenceMedia_container') details.classList.add('_ext-openExcellenceMedia_container')
......
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "OpenExcellenceMedia", "name": "OpenExcellenceMedia",
"version": "0.0.3", "version": "0.0.4",
"description": "Adds download links to videos on RWTH moodle which are served using an OpenCast iframe.", "description": "Adds download links to videos on RWTH moodle which are served using an OpenCast iframe.",
"homepage_url": "https://git.fsmpi.rwth-aachen.de/moodleOpenCastDownloads/ff-ext", "homepage_url": "https://git.fsmpi.rwth-aachen.de/moodleOpenCastDownloads/ff-ext",
"icons": { "icons": {
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"content_scripts": [ "content_scripts": [
{ {
"all_frames": true, "all_frames": true,
"matches": ["https://moodle.rwth-aachen.de/*", "https://engage.streaming.rwth-aachen.de/paella/ui/*"], "matches": ["https://moodle.rwth-aachen.de/*", "https://engage.streaming.rwth-aachen.de/*"],
"js": ["free.js"], "js": ["free.js"],
"css": ["free.css"] "css": ["free.css"]
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment