Issue #2831274 by slashrsm, seanB, Wim Leers, chr.fritsch, phenaproxima, naveenvalecha, marcoscano, webflo, Gábor Hojtsy, amateescu, Boobaa, iMiksu, mtodor, effulgentsia, xjm, Berdir, tim.plunkett, dawehner, tkoleary, tstoeckler, tedbow, alexpott, yoroy, catch, Bojhan, andypost, jhedstrom, jibran, aspilicious, boztek, cbr, bigbaldy, alex0412, dagmar, blueminds, ekes, Dave Reid, Sam152, bojanz, pixelmord, jonathanshaw, CTaPByK, webchick, samuel.mortenson, dbt102, dishabhadra, proweb.ua, rakesh.gectcr, rasikap, paranojik, pameeela, neardark, NormySan, Primsi, nicolas.rafaelli, romainj, royal121, vladan.me, vpeltot, woprrr, vilepickle, toni04, scheban, tduong, temkin, tim-e, mbovan, mashermike, felribeiro, giancarlosotelo, hctom, euphoric_mv, eric.duran7@gmail.com, edurenye, eelkeblok, H1ghlander, Jaesin, hkirsman, ja_ca, NickWilde, joachim, joshi.rohit100, marcingy, NerOcrO, Mixologic, jcisio, jfrederick, Lukas von Blarer, Maouna: Bring Media entity module to core as Media module
2017-05-19 12:57:59 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Hooks related to Media and its plugins.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @addtogroup hooks
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Alters the information provided in \Drupal\media\Annotation\MediaSource.
|
|
|
|
*
|
|
|
|
* @param array $sources
|
|
|
|
* The array of media source plugin definitions, keyed by plugin ID.
|
|
|
|
*/
|
|
|
|
function hook_media_source_info_alter(array &$sources) {
|
|
|
|
$sources['youtube']['label'] = t('Youtube rocks!');
|
|
|
|
}
|
|
|
|
|
Issue #2831944 by chr.fritsch, phenaproxima, alexpott, marcoscano, slashrsm, seanB, robpowell, samuel.mortenson, tstoeckler, Wim Leers, dawehner, martin107, Gábor Hojtsy, aheimlich, tedbow, mtodor, larowlan, idebr, bkosborne, ckrina: Implement media source plugin for remote video via oEmbed
2018-06-21 08:11:10 +00:00
|
|
|
/**
|
|
|
|
* Alters an oEmbed resource URL before it is fetched.
|
|
|
|
*
|
|
|
|
* @param array $parsed_url
|
|
|
|
* A parsed URL, as returned by \Drupal\Component\Utility\UrlHelper::parse().
|
|
|
|
* @param \Drupal\media\OEmbed\Provider $provider
|
|
|
|
* The oEmbed provider for the resource.
|
|
|
|
*
|
|
|
|
* @see \Drupal\media\OEmbed\UrlResolverInterface::getResourceUrl()
|
|
|
|
*/
|
|
|
|
function hook_oembed_resource_url_alter(array &$parsed_url, \Drupal\media\OEmbed\Provider $provider) {
|
|
|
|
// Always serve YouTube videos from youtube-nocookie.com.
|
|
|
|
if ($provider->getName() === 'YouTube') {
|
|
|
|
$parsed_url['path'] = str_replace('://youtube.com/', '://youtube-nocookie.com/', $parsed_url['path']);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Issue #2831274 by slashrsm, seanB, Wim Leers, chr.fritsch, phenaproxima, naveenvalecha, marcoscano, webflo, Gábor Hojtsy, amateescu, Boobaa, iMiksu, mtodor, effulgentsia, xjm, Berdir, tim.plunkett, dawehner, tkoleary, tstoeckler, tedbow, alexpott, yoroy, catch, Bojhan, andypost, jhedstrom, jibran, aspilicious, boztek, cbr, bigbaldy, alex0412, dagmar, blueminds, ekes, Dave Reid, Sam152, bojanz, pixelmord, jonathanshaw, CTaPByK, webchick, samuel.mortenson, dbt102, dishabhadra, proweb.ua, rakesh.gectcr, rasikap, paranojik, pameeela, neardark, NormySan, Primsi, nicolas.rafaelli, romainj, royal121, vladan.me, vpeltot, woprrr, vilepickle, toni04, scheban, tduong, temkin, tim-e, mbovan, mashermike, felribeiro, giancarlosotelo, hctom, euphoric_mv, eric.duran7@gmail.com, edurenye, eelkeblok, H1ghlander, Jaesin, hkirsman, ja_ca, NickWilde, joachim, joshi.rohit100, marcingy, NerOcrO, Mixologic, jcisio, jfrederick, Lukas von Blarer, Maouna: Bring Media entity module to core as Media module
2017-05-19 12:57:59 +00:00
|
|
|
/**
|
|
|
|
* @} End of "addtogroup hooks".
|
|
|
|
*/
|