Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293581

oEmbed system doesn't work if thumbnail url does not have a file extension

$
0
0

Problem/Motivation

I am trying using our instance of Kaltura Mediaspace as an oEmbed provider. I'm using hook_oembed_providers_alter() from https://www.drupal.org/project/drupal/issues/3008119 to add the provider and this works fine. However, the thumbnail_url value in the oEmbed response does not contain a file extension. The local copy of the thumbnail is then unusable and the following warning is thrown.

Could not apply Medium (220×220) image style to public://oembed_thumbnails/5qPKeF_Fcn22-QFyRf6_CK8IX1YMBi4xeeLOjBrlWtY. because the style does not support it.

Example oEmbed:https://media.unh.edu/oembed?url=https://media.unh.edu/id/1_9qymc7ie?wid...

{  
   "entryId":"1_9qymc7ie",
   "version":"1.0",
   "type":"video",
   "provider_url":"https:\/\/media.unh.edu\/",
   "provider_name":"UNH Media",
   "title":"2018 Racial Equity Challenge Webinar:  Sowing the Seeds of Equity",
   "width":"400",
   "height":"285",
   "playerId":"30754212",
   "thumbnail_height":"285",
   "thumbnail_width":"400",
   "thumbnail_url":"https:\/\/cfvod.kaltura.com\/p\/505811\/sp\/50581100\/thumbnail\/entry_id\/1_9qymc7ie\/version\/100021\/width\/400\/height\/285",
   "author_name":"lmf2023",
   "html":"<iframe id=\"kaltura_player\" src=\"https:\/\/cdnapisec.kaltura.com\/p\/505811\/sp\/50581100\/embedIframeJs\/uiconf_id\/30754212\/partner_id\/505811?iframeembed=true&playerId=kaltura_player&entry_id=1_9qymc7ie&flashvars[leadWithHTML5]=true&flashvars[streamerType]=auto&flashvars[localizationCode]=en&flashvars[sideBarContainer.plugin]=true&flashvars[sideBarContainer.position]=left&flashvars[sideBarContainer.clickToClose]=true&flashvars[chapters.plugin]=true&flashvars[chapters.layout]=vertical&flashvars[chapters.thumbnailRotator]=false&flashvars[streamSelector.plugin]=true&flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&flashvars[dualScreen.plugin]=true&flashvars[Kaltura.addCrossoriginToIframe]=true&wid=1_qmha8084\" width=\"400\" height=\"285\" allowfullscreen webkitallowfullscreen mozAllowFullScreen allow=\"autoplay *; fullscreen *; encrypted-media *\" frameborder=\"0\" title=\"Kaltura Player\"><\/iframe>"
}

Proposed resolution

If no file extension is included then use the MIME type of the thumbnail to add a file extension to the local copy of the thumbnail. Not sure if this is a viable solution.

Remaining tasks

Release notes snippet


Viewing all articles
Browse latest Browse all 293581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>