A handful more providers moved across & removed any that no longer supported

This commit is contained in:
Warren Buckley
2019-01-30 21:52:12 +00:00
parent 880faeebd3
commit fe9700b3f7
5 changed files with 62 additions and 26 deletions

View File

@@ -11,15 +11,6 @@
<param name="scheme">https</param>
</requestParams>
</provider>
<!-- Issuu Settings -->
<provider name="Issuu" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, Umbraco.Web">
<urlShemeRegex><![CDATA[issuu.com/(?:.*)/docs]]></urlShemeRegex>
<apiEndpoint><![CDATA[https://issuu.com/oembed]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web">
<param name="format">json</param>
</requestParams>
</provider>
<!-- Daily Motion -->
<provider name="DailyMotion" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
@@ -29,21 +20,5 @@
<param name="format">xml</param>
</requestParams>
</provider>
<!-- Hulu -->
<provider name="Hulu" type="Umbraco.Web.Media.EmbedProviders.OEmbedVideo, Umbraco.Web">
<urlShemeRegex><![CDATA[hulu\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.hulu.com/api/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web">
<param name="format">xml</param>
</requestParams>
</provider>
<!-- IFTTT Settings -->
<provider name="IFTTT" type="Umbraco.Web.Media.EmbedProviders.OEmbedJson, Umbraco.Web">
<urlShemeRegex><![CDATA[ifttt\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[http://www.ifttt.com/oembed/]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, Umbraco.Web"></requestParams>
</provider>
</embed>

View File

@@ -0,0 +1,24 @@
using System.Collections.Generic;
namespace Umbraco.Web.Media.EmbedProviders
{
public class Hulu : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.hulu.com/api/oembed.json";
public override string[] UrlSchemeRegex => new string[]
{
@"hulu.com/watch/.*"
};
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
{
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
var oembed = base.GetJsonResponse<OEmbedResponse>(requestUrl);
return oembed.GetHtml();
}
}
}

View File

@@ -0,0 +1,28 @@
using System.Collections.Generic;
namespace Umbraco.Web.Media.EmbedProviders
{
public class Issuu : EmbedProviderBase
{
public override string ApiEndpoint => "https://issuu.com/oembed";
public override string[] UrlSchemeRegex => new string[]
{
@"issuu.com/.*/docs/.*"
};
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>()
{
//ApiUrl/?format=xml
{"format", "xml"}
};
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
{
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
var xmlDocument = base.GetXmlResponse(requestUrl);
return GetXmlProperty(xmlDocument, "/oembed/html");
}
}
}

View File

@@ -225,7 +225,14 @@ namespace Umbraco.Web.Runtime
.Append<Twitter>()
.Append<Vimeo>()
.Append<Ted>()
.Append<Soundcloud>();
.Append<Soundcloud>()
.Append<Issuu>()
.Append<Hulu>();
//Giphy
//Meetup
//Spotify
}
}
}

View File

@@ -149,7 +149,9 @@
<Compile Include="Media\EmbedProviders\Flickr.cs" />
<Compile Include="Media\EmbedProviders\GettyImages.cs" />
<Compile Include="Media\EmbedProviders\SoundCloud.cs" />
<Compile Include="Media\EmbedProviders\Hulu.cs" />
<Compile Include="Media\EmbedProviders\Ted.cs" />
<Compile Include="Media\EmbedProviders\Issuu.cs" />
<Compile Include="Media\EmbedProviders\Vimeo.cs" />
<Compile Include="Media\EmbedProviders\Twitter.cs" />
<Compile Include="Media\EmbedProviders\Kickstarter.cs" />