# EmbedProvider
Class
## About
`EmbedProvider` describes a site that `EmbedNode` can embed: its name, its oEmbed endpoint, the page addresses it serves, and the hosts its embedded frames load from.
`EmbedNode` has a built-in allowlist of YouTube, Vimeo, Spotify, SoundCloud, and CodePen. Add a provider to allow another site:
```xojo
Var patterns() As String = Array("example.tv/watch/")
Var hosts() As String = Array("player.example.tv")
GraffitiProEditor.EmbedNode.AddProvider(New GraffitiProEditor.EmbedProvider("Example TV", "https://example.tv/oembed", patterns, hosts))
```
Address patterns are prefixes compared without the scheme and a leading `www.`, so `youtube.com/watch` matches `https://www.youtube.com/watch?v=…`. An embedded frame is exported as an `iframe` only when it is HTTPS and its host is one of the provider's embed hosts; anything else exports as a link.
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| AllowsEmbedSource | source As String | Boolean | Returns whether the supplied frame address is on one of this provider's embed hosts, so it may be exported as an iframe. |
| Constructor | name As String <br> endpoint As String <br> urlPatterns() As String <br> embedHosts() As String | (None) | Creates a provider from its name, its oEmbed endpoint, the address prefixes it serves, such as youtube.com/watch, and the hosts its embedded frames load from. |
| EmbedHosts | (None) | String | Returns the hosts this provider's embedded frames may load from. |
| Matches | url As String | Boolean | Returns whether this provider serves the supplied address. |
| RequestURL | url As String | String | Returns the oEmbed request address for the supplied page address. |
| URLPatterns | (None) | String | Returns the address prefixes this provider serves, without scheme or www. |
## Properties
| Name | Type | Default Value | Description |
| --- | :---: | :---: | --- |
| Endpoint | String | (None) | Gets or sets the provider's oEmbed endpoint. The editor adds format=json and the page address to it. |
| Name | String | (None) | Gets or sets the provider's display name, such as YouTube. EmbedNode.RemoveProvider finds providers by it. |