SSHOC / sshoc-marketplace-backend

Code for the backend
Apache License 2.0
2 stars 0 forks source link

Vimeo links bug #393

Open laureD19 opened 1 year ago

laureD19 commented 1 year ago

Which link to use to display Vimeo videos under media? When using the standard url or the embed one, nothing appears. Exemple: https://marketplace.sshopencloud.eu/tool-or-service/C5u2Yb

stefanprobst commented 1 year ago

looks like the backend treats this link as an object media type:

curl https://marketplace-api.sshopencloud.eu/api/tools-services/C5u2Yb | jq '.media'

returns

[
  {
    "info": {
      "category": "object",
      "hasThumbnail": false,
      "location": {
        "sourceUrl": "https://vimeo.com/461293952"
      },
      "mediaId": "0a2109c1-fe26-44f8-adf9-3b4be4d125d4",
      "mimeType": "text/html;charset=UTF-8"
    }
  }
]
stefanprobst commented 1 year ago
curl https://marketplace-api.sshopencloud.eu/api/media-sources | jq

returns these configured media sources:

[
  {
    "code": "youtube",
    "mediaCategory": "embed",
    "ord": 1,
    "serviceUrl": "https://www.youtube.com/embed"
  },
  {
    "code": "vimeo",
    "mediaCategory": "embed",
    "ord": 2,
    "serviceUrl": "https://vimeo.com/watch"
  }
]
stefanprobst commented 1 year ago

so the backend expects urls starting with "https://vimeo.com/watch" - although that does not seem to be correct.

valid vimeo embed links should look like this afaict: "https://player.vimeo.com/video/461293952"

so the media-souce configuration would need to be updated backend-side

laureD19 commented 1 year ago

ok, thanks a lot for looking into it! Changing the assignee to Tomasz.

KlausIllmayer commented 1 year ago

We are able to change the serviceUrl by our own, so probably we don't need to do changes in the backend. I will try out, what happens when we do this on stage and will report back here.

KlausIllmayer commented 1 year ago

Tried out a lot and finally found a solution. The problem is, that some videos on Vimeo are not allowed to embed. And luckily I had such one. If this is the case, the backend delivers back an ugly message and the input forms will crash. Not sure, if we like to tackle this somehow. If so, it is an issue for backend.

Otherwise, I changed the serviceUrl of embedded vimeo videos to https://player.vimeo.com/video/ - you can see here an example: https://player.vimeo.com/video/28789460

If afterwards I upload a vimeo video - but you need to use the embed url like the example above - it will show the vimeo embedded in marketplace. I've already updated the one by Laure: https://marketplace.sshopencloud.eu/tool-or-service/C5u2Yb

Additionally for curation: I saw that there are old embedded videos inside the database, with the wrong youtube link (we once had the serviceUrl not correct). I guess, we should correct them and maybe also tackle the current ones, that are interpreted not as EMBED but as OBJECT due to not using the youtube-embed-URL.

tparkola commented 1 year ago

This is related to https://github.com/SSHOC/sshoc-marketplace-backend/issues/146. Media sources are not handled as we would expect I think, so we need to have a discussion about that. We need to discuss validation and the way we want to identify if media_data is of EMBED type. Currently the behaviour is not what we all would expect I think.

laureD19 commented 4 months ago

while trying to manually update the three items still presenting wrong Vimeo links - see list in our curation minutes here - I end up with a "failed to upload media" message.

Any idea why @KlausIllmayer ? notify also @mkrzmr

laureD19 commented 4 months ago

error messages from the backend: "2024-06-06T12:37:35.817073136Z java.lang.IllegalArgumentException: Media resource client error" "2024-06-06T12:37:35.817079448Z at eu.sshopencloud.marketplace.domain.media.MediaExternalClient.resolveMediaInfo(MediaExternalClient.java:74)"

laureD19 commented 4 months ago

add how to replicate

mkrzmr commented 3 days ago

Here is my attempt to replicate this issue:

1.

2.

    • Same as above, but use the vimeo embedd code <div style="padding:56.25% 0 0 0;position:relative;"><iframe src="https://player.vimeo.com/video/348838959?badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write" style="position:absolute;top:0;left:0;width:100%;height:100%;" title="How to search on Vimeo"></iframe></div><script src="https://player.vimeo.com/api/player.js"></script>
    • MP UI does not allow this input