Skip to content

Commit

Permalink
MediaEmbed: updated Kaltura
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Jan 29, 2024
1 parent 8fd33f3 commit 7372cd0
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 72 deletions.
2 changes: 1 addition & 1 deletion docs/Plugins/MediaEmbed/Sites.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
</tr>
<tr title="Kaltura" id="kaltura">
<td><code>kaltura</code></td>
<td>https://www.kaltura.com/tiny/b5tib<br/>https://vcu.mediaspace.kaltura.com/media/t/1_hu0rc15a</td>
<td>https://www.kaltura.com/tiny/p8a9z<br/>https://videos.kaltura.com/media/1_Kaltura+Video+Tips+-+Preparation/1_p59fv7ur</td>
</tr>
<tr title="Kontinental Hockey League (КХЛ)" id="khl">
<td><code>khl</code></td>
Expand Down
124 changes: 62 additions & 62 deletions src/Bundles/MediaPack.php

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Bundles/MediaPack/Renderer.php

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class CachedDefinitionCollection extends SiteDefinitionCollection
'izlesene'=>['amp'=>['custom-element'=>'amp-izlesene','src'=>'https://cdn.ampproject.org/v0/amp-izlesene-0.1.js','template'=>'<amp-izlesene layout="responsive" width="640" height="360" data-videoid="{@id}"/>'],'attributes'=>[],'example'=>'https://www.izlesene.com/video/kardan-adamin-salincak-keyfi/10553555','extract'=>['!izlesene\\.com/video/[-\\w]+/(?\'id\'\\d+)!'],'homepage'=>'https://www.izlesene.com/','host'=>['izlesene.com'],'iframe'=>['src'=>'//www.izlesene.com/embedplayer/{@id}?autoplay=0'],'name'=>'İzlesene','scrape'=>[],'tags'=>['.tr']],
'jsfiddle'=>['attributes'=>[],'example'=>'https://jsfiddle.net/1v03Lqnu/','extract'=>['@jsfiddle.net/(?:(?\'user\'\\w+)/)?(?!\\d+\\b|embedded\\b|show\\b)(?\'id\'\\w+)\\b(?:/(?\'revision\'\\d+)\\b)?@'],'homepage'=>'https://jsfiddle.net/','host'=>['jsfiddle.net'],'iframe'=>['height'=>400,'src'=>'//jsfiddle.net/{@id}/{@revision}/embedded/{$MEDIAEMBED_THEME}/','width'=>'100%'],'name'=>'JSFiddle','scrape'=>[],'tags'=>['programming']],
'jwplatform'=>['attributes'=>[],'example'=>['https://content.jwplatform.com/players/X6tRZpKj-7Y21S9TB.html','https://content.jwplatform.com/previews/YfTSAegE-L0l35Tsd'],'extract'=>['!jwplatform\\.com/\\w+/(?\'id\'[-\\w]+)!'],'homepage'=>'https://www.jwplayer.com/products/jwplatform/','host'=>['jwplatform.com'],'iframe'=>['src'=>'//content.jwplatform.com/players/{@id}.html'],'name'=>'JW Platform','scrape'=>[],'tags'=>['videos']],
'kaltura'=>['amp'=>['custom-element'=>'amp-kaltura-player','src'=>'https://cdn.ampproject.org/v0/amp-kaltura-player-0.1.js','template'=>'<amp-kaltura-player layout="responsive" width="640" height="360" data-service-url="cdnapisec.kaltura.com" data-uiconf="{@uiconf_id}" data-partner="{@partner_id}" data-entryid="{@entry_id}" data-param-streamertype="auto"/>'],'attributes'=>['entry_id'=>['required'=>true],'partner_id'=>['required'=>true],'uiconf_id'=>['required'=>true]],'example'=>['https://www.kaltura.com/tiny/b5tib','https://vcu.mediaspace.kaltura.com/media/t/1_hu0rc15a'],'extract'=>['@/p(?:artner_id)?/(?\'partner_id\'\\d+)/@','@/sp/(?\'sp\'\\d+)/@','@/uiconf_id/(?\'uiconf_id\'\\d+)/@','@\\bentry_id[=/](?\'entry_id\'\\w+)@'],'homepage'=>'https://corp.kaltura.com/','host'=>['kaltura.com'],'iframe'=>['padding-height'=>36,'src'=>'https://cdnapisec.kaltura.com/p/<xsl:value-of select="@partner_id"/>/sp/<xsl:choose><xsl:when test="@sp"><xsl:value-of select="@sp"/></xsl:when><xsl:otherwise><xsl:value-of select="@partner_id"/>00</xsl:otherwise></xsl:choose>/embedIframeJs/uiconf_id/<xsl:value-of select="@uiconf_id"/>/partner_id/<xsl:value-of select="@partner_id"/>?iframeembed=true&amp;entry_id=<xsl:value-of select="@entry_id"/>'],'name'=>'Kaltura','scrape'=>[['extract'=>['@kaltura\\.com/+p/(?\'partner_id\'\\d+)/sp/(?\'sp\'\\d+)/\\w*/uiconf_id/(?\'uiconf_id\'\\d+)/.*?\\bentry_id=(?\'entry_id\'\\w+)@'],'match'=>['@kaltura\\.com/(?:media/t|tiny)/.@']]],'tags'=>['videos']],
'kaltura'=>['amp'=>['custom-element'=>'amp-kaltura-player','src'=>'https://cdn.ampproject.org/v0/amp-kaltura-player-0.1.js','template'=>'<amp-kaltura-player layout="responsive" width="640" height="360" data-service-url="cdnapisec.kaltura.com" data-uiconf="{@uiconf_id}" data-partner="{@partner_id}" data-entryid="{@entry_id}" data-param-streamertype="auto"/>'],'attributes'=>['entry_id'=>['required'=>true],'partner_id'=>['required'=>true],'uiconf_id'=>['required'=>true]],'example'=>['https://www.kaltura.com/tiny/p8a9z','https://videos.kaltura.com/media/1_Kaltura+Video+Tips+-+Preparation/1_p59fv7ur'],'extract'=>['@/p(?:artner_id)?/(?\'partner_id\'\\d+)/@','@/sp/(?\'sp\'\\d+)/@','@/uiconf_id/(?\'uiconf_id\'\\d+)/@','@\\bentry_id[=/](?\'entry_id\'\\w+)@'],'homepage'=>'https://corp.kaltura.com/','host'=>['kaltura.com'],'iframe'=>['src'=>'https://cdnapisec.kaltura.com/p/<xsl:value-of select="@partner_id"/>/sp/<xsl:choose><xsl:when test="@sp"><xsl:value-of select="@sp"/></xsl:when><xsl:otherwise><xsl:value-of select="@partner_id"/>00</xsl:otherwise></xsl:choose>/embedIframeJs/uiconf_id/<xsl:value-of select="@uiconf_id"/>/partner_id/<xsl:value-of select="@partner_id"/>?iframeembed=true&amp;entry_id=<xsl:value-of select="@entry_id"/>'],'name'=>'Kaltura','scrape'=>[['extract'=>['@kaltura\\.com/p/(?\'partner_id\'\\d+)/sp/(?\'sp\'\\d+)/\\w*/uiconf_id/(?\'uiconf_id\'\\d+)(?:/.*?\\bentry_id=(?\'entry_id\'\\w+))?@','@/entry_id/(?\'entry_id\'\\w+)@'],'match'=>['@kaltura\\.com/(?:media|tiny)/.@']]],'tags'=>['videos']],
'khl'=>['attributes'=>[],'example'=>['https://video.khl.ru/events/233677','https://video.khl.ru/quotes/251237'],'extract'=>[],'homepage'=>'https://www.khl.ru/','host'=>['video.khl.ru'],'iframe'=>['src'=>'//video.khl.ru/iframe/feed/start/{@id}?type_id=18&width=560&height=315'],'name'=>'Kontinental Hockey League (КХЛ)','scrape'=>[['extract'=>['!/feed/start/(?\'id\'[/\\w]+)!'],'match'=>['!video\\.khl\\.ru/(?:event|quote)s/\\d!']]],'tags'=>['.ru','sports']],
'kickstarter'=>['attributes'=>[],'choose'=>['otherwise'=>['iframe'=>['height'=>420,'src'=>'//www.kickstarter.com/projects/{@id}/widget/card.html','width'=>220]],'when'=>['iframe'=>['height'=>360,'src'=>'//www.kickstarter.com/projects/{@id}/widget/video.html','width'=>640],'test'=>'@video']],'example'=>['https://www.kickstarter.com/projects/1869987317/wish-i-was-here-1','https://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/card.html','https://www.kickstarter.com/projects/1869987317/wish-i-was-here-1/widget/video.html'],'extract'=>['!kickstarter\\.com/projects/(?\'id\'[^/]+/[^/?]+)(?:/widget/(?:(?\'card\'card)|(?\'video\'video)))?!'],'homepage'=>'https://www.kickstarter.com/','host'=>['kickstarter.com'],'name'=>'Kickstarter','scrape'=>[],'tags'=>['fundraising']],
'libsyn'=>['attributes'=>[],'example'=>'https://pexlives.libsyn.com/the-ark-in-space-ep4-commentary-with-el-and-jack','extract'=>[],'homepage'=>'https://www.libsyn.com/','host'=>['libsyn.com'],'iframe'=>['height'=>90,'max-width'=>900,'src'=>'//html5-player.libsyn.com/embed/episode/id/{@id}/thumbnail/no','width'=>'100%'],'name'=>'Libsyn','scrape'=>[['extract'=>['!embed/episode/id/(?\'id\'\\d+)!'],'match'=>['@(?!\\.mp3)....$@']]],'tags'=>['podcasts']],
Expand Down
11 changes: 6 additions & 5 deletions src/Plugins/MediaEmbed/Configurator/sites/kaltura.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<site name="Kaltura" homepage="https://corp.kaltura.com/">
<example>https://www.kaltura.com/tiny/b5tib</example>
<example>https://vcu.mediaspace.kaltura.com/media/t/1_hu0rc15a</example>
<example>https://www.kaltura.com/tiny/p8a9z</example>
<example>https://videos.kaltura.com/media/1_Kaltura+Video+Tips+-+Preparation/1_p59fv7ur</example>

<tags><tag>videos</tag></tags>

Expand All @@ -16,10 +16,11 @@
<extract>@/uiconf_id/(?'uiconf_id'\d+)/@</extract>
<extract>@\bentry_id[=/](?'entry_id'\w+)@</extract>
<scrape>
<match>@kaltura\.com/(?:media/t|tiny)/.@</match>
<extract>@kaltura\.com/+p/(?'partner_id'\d+)/sp/(?'sp'\d+)/\w*/uiconf_id/(?'uiconf_id'\d+)/.*?\bentry_id=(?'entry_id'\w+)@</extract>
<match>@kaltura\.com/(?:media|tiny)/.@</match>
<extract>@kaltura\.com/p/(?'partner_id'\d+)/sp/(?'sp'\d+)/\w*/uiconf_id/(?'uiconf_id'\d+)(?:/.*?\bentry_id=(?'entry_id'\w+))?@</extract>
<extract>@/entry_id/(?'entry_id'\w+)@</extract>
</scrape>
<iframe padding-height="36">
<iframe>
<src><![CDATA[
<xsl:text>https://cdnapisec.kaltura.com/p/</xsl:text>
<xsl:value-of select="@partner_id"/>
Expand Down
2 changes: 1 addition & 1 deletion tests/Plugins/MediaEmbed/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4460,7 +4460,7 @@ function ($configurator)
],
[
'https://cdnapisec.kaltura.com/html5/html5lib/v2.73.2/mwEmbedFrame.php/p/1674401/uiconf_id/23435151/entry_id/1_dtmilkcn?wid=_1674401&iframeembed=true&playerId=kaltura_player&entry_id=1_dtmilkcn',
'<span data-s9e-mediaembed="kaltura" style="display:inline-block;width:100%;max-width:640px"><span style="display:block;overflow:hidden;position:relative;padding-bottom:61.875%;padding-bottom:calc(56.25% + 36px)"><iframe allowfullscreen="" loading="lazy" scrolling="no" style="border:0;height:100%;left:0;position:absolute;width:100%" src="https://cdnapisec.kaltura.com/p/1674401/sp/167440100/embedIframeJs/uiconf_id/23435151/partner_id/1674401?iframeembed=true&amp;entry_id=1_dtmilkcn"></iframe></span></span>',
'<span data-s9e-mediaembed="kaltura" style="display:inline-block;width:100%;max-width:640px"><span style="display:block;overflow:hidden;position:relative;padding-bottom:56.25%"><iframe allowfullscreen="" loading="lazy" scrolling="no" style="border:0;height:100%;left:0;position:absolute;width:100%" src="https://cdnapisec.kaltura.com/p/1674401/sp/167440100/embedIframeJs/uiconf_id/23435151/partner_id/1674401?iframeembed=true&amp;entry_id=1_dtmilkcn"></iframe></span></span>',
[],
function ($configurator)
{
Expand Down

0 comments on commit 7372cd0

Please sign in to comment.