Skip to content

Commit 651cdf5

Browse files
committed
docs: add useLocalHTML and baseUrlOverride to TS declarations
1 parent 068445f commit 651cdf5

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

docs/self_host.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: self-host-remote-source
3+
title: Self Host Static HTML page that handles the player
4+
---
5+
6+
Prior to `v2.0.0`, this package would generate HTML required for the youtube iframe and serve it as raw HTML string.
7+
This meant that the base URL would be `'about:blank'` and leading to a number of videos showing a "embed not allowed" error message.
8+
9+
To mitigate this - the webpage had to be uploaded on to a trustable remote source (github pages).
10+
The source code of the [static HTML](https://github.com/LonelyCpp/react-native-youtube-iframe/blob/master/iframe.html) is minified and uploaded as a part of the documentation website [here](https://lonelycpp.github.io/react-native-youtube-iframe/iframe.html).
11+
12+
For whatever reason, if you would like to host this page on your own web server - the [static HTML](https://github.com/LonelyCpp/react-native-youtube-iframe/blob/master/iframe.html) source can be hosted as it is. _(not recommended since manual update will be required)_

index.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ export interface YoutubeIframeProps {
128128
* <meta /> tag on the webpage
129129
*/
130130
contentScale?: number;
131+
/**
132+
* force use locally generated HTML string. defaults to `false`
133+
*/
134+
useLocalHTML?: boolean;
135+
/**
136+
* url that fetches a webpage compatible with youtube iframe interface
137+
*
138+
* * defaults to : https://lonelycpp.github.io/react-native-youtube-iframe/iframe.html
139+
* * for code check "iframe.html" in package repo
140+
*/
141+
baseUrlOverride?: string;
131142
}
132143

133144
export interface YoutubeMeta {

website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ module.exports = {
55
'component-props',
66
'component-ref-methods',
77
'module-methods',
8+
'self-host-remote-source',
89
],
910
FAQ: ['play-store-compatibility', 'remove-context-share', 'elapsed-time'],
1011
},

0 commit comments

Comments
 (0)