elan-ev / studip-opencast-plugin

This is an Stud.IP plugin for Opencast
https://elan-ev.github.io/studip-opencast-plugin/
GNU General Public License v2.0
9 stars 20 forks source link

Player URL possibly invalid #1004

Open lkiesow opened 1 week ago

lkiesow commented 1 week ago

The plugin looks for the search service and then uses ${search.service.host}/play/${id} to link to the player. That's not necessarily correct and caused a completely broken plugin for us after the last update:

https://github.com/elan-ev/studip-opencast-plugin/blob/5a61bb6d5e0d789864ced15286e6d7cb4d50e4e1/controllers/redirect.php#L36-L43

Instead of using the search service, the plugin should actually use org.opencastproject.engage.ui.player.redirect which provides /play. The service should usually be on the presentation node:

❯ curl -s -u admin:opencast 'https://develop.opencast.org/services/services.json?serviceType=org.opencastproject.engage.ui.player.redirect' | jq
{
  "services": {
    "service": {
      "type": "org.opencastproject.engage.ui.player.redirect",
      "host": "https://develop.opencast.org",
      "path": "/play",
      "active": true,
      "online": true,
      "maintenance": false,
      "jobproducer": false,
      "onlinefrom": "2024-09-17T02:00:59.370+02:00",
      "service_state": "NORMAL",
      "state_changed": "2024-09-17T02:00:59.370+02:00",
      "error_state_trigger": 0,
      "warning_state_trigger": 0
    }
  }
}
tgloeggl commented 1 day ago

This also is a problem in the new plugin version