@tiptap/extension-youtube 2.11.7 → 3.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +5 -1
- package/dist/index.cjs +266 -218
- package/dist/index.cjs.map +1 -1
- package/dist/{youtube.d.ts → index.d.cts} +5 -4
- package/dist/index.d.ts +164 -4
- package/dist/index.js +241 -215
- package/dist/index.js.map +1 -1
- package/package.json +10 -8
- package/src/utils.ts +24 -22
- package/src/youtube.ts +36 -34
- package/dist/index.d.ts.map +0 -1
- package/dist/index.umd.js +0 -246
- package/dist/index.umd.js.map +0 -1
- package/dist/utils.d.ts +0 -27
- package/dist/utils.d.ts.map +0 -1
- package/dist/youtube.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,164 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
interface YoutubeOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Controls if the paste handler for youtube videos should be added.
|
|
6
|
+
* @default true
|
|
7
|
+
* @example false
|
|
8
|
+
*/
|
|
9
|
+
addPasteHandler: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Controls if the youtube video should be allowed to go fullscreen.
|
|
12
|
+
* @default true
|
|
13
|
+
* @example false
|
|
14
|
+
*/
|
|
15
|
+
allowFullscreen: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Controls if the youtube video should autoplay.
|
|
18
|
+
* @default false
|
|
19
|
+
* @example true
|
|
20
|
+
*/
|
|
21
|
+
autoplay: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The language of the captions shown in the youtube video.
|
|
24
|
+
* @default undefined
|
|
25
|
+
* @example 'en'
|
|
26
|
+
*/
|
|
27
|
+
ccLanguage?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Controls if the captions should be shown in the youtube video.
|
|
30
|
+
* @default undefined
|
|
31
|
+
* @example true
|
|
32
|
+
*/
|
|
33
|
+
ccLoadPolicy?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Controls if the controls should be shown in the youtube video.
|
|
36
|
+
* @default true
|
|
37
|
+
* @example false
|
|
38
|
+
*/
|
|
39
|
+
controls: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Controls if the keyboard controls should be disabled in the youtube video.
|
|
42
|
+
* @default false
|
|
43
|
+
* @example true
|
|
44
|
+
*/
|
|
45
|
+
disableKBcontrols: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Controls if the iframe api should be enabled in the youtube video.
|
|
48
|
+
* @default false
|
|
49
|
+
* @example true
|
|
50
|
+
*/
|
|
51
|
+
enableIFrameApi: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* The end time of the youtube video.
|
|
54
|
+
* @default 0
|
|
55
|
+
* @example 120
|
|
56
|
+
*/
|
|
57
|
+
endTime: number;
|
|
58
|
+
/**
|
|
59
|
+
* The height of the youtube video.
|
|
60
|
+
* @default 480
|
|
61
|
+
* @example 720
|
|
62
|
+
*/
|
|
63
|
+
height: number;
|
|
64
|
+
/**
|
|
65
|
+
* The language of the youtube video.
|
|
66
|
+
* @default undefined
|
|
67
|
+
* @example 'en'
|
|
68
|
+
*/
|
|
69
|
+
interfaceLanguage?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Controls if the video annotations should be shown in the youtube video.
|
|
72
|
+
* @default 0
|
|
73
|
+
* @example 1
|
|
74
|
+
*/
|
|
75
|
+
ivLoadPolicy: number;
|
|
76
|
+
/**
|
|
77
|
+
* Controls if the youtube video should loop.
|
|
78
|
+
* @default false
|
|
79
|
+
* @example true
|
|
80
|
+
*/
|
|
81
|
+
loop: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Controls if the youtube video should show a small youtube logo.
|
|
84
|
+
* @default false
|
|
85
|
+
* @example true
|
|
86
|
+
*/
|
|
87
|
+
modestBranding: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* The HTML attributes for a youtube video node.
|
|
90
|
+
* @default {}
|
|
91
|
+
* @example { class: 'foo' }
|
|
92
|
+
*/
|
|
93
|
+
HTMLAttributes: Record<string, any>;
|
|
94
|
+
/**
|
|
95
|
+
* Controls if the youtube node should be inline or not.
|
|
96
|
+
* @default false
|
|
97
|
+
* @example true
|
|
98
|
+
*/
|
|
99
|
+
inline: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Controls if the youtube video should be loaded from youtube-nocookie.com.
|
|
102
|
+
* @default false
|
|
103
|
+
* @example true
|
|
104
|
+
*/
|
|
105
|
+
nocookie: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* The origin of the youtube video.
|
|
108
|
+
* @default ''
|
|
109
|
+
* @example 'https://tiptap.dev'
|
|
110
|
+
*/
|
|
111
|
+
origin: string;
|
|
112
|
+
/**
|
|
113
|
+
* The playlist of the youtube video.
|
|
114
|
+
* @default ''
|
|
115
|
+
* @example 'PLQg6GaokU5CwiVmsZ0dZm6VeIg0V5z1tK'
|
|
116
|
+
*/
|
|
117
|
+
playlist: string;
|
|
118
|
+
/**
|
|
119
|
+
* The color of the youtube video progress bar.
|
|
120
|
+
* @default undefined
|
|
121
|
+
* @example 'red'
|
|
122
|
+
*/
|
|
123
|
+
progressBarColor?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The width of the youtube video.
|
|
126
|
+
* @default 640
|
|
127
|
+
* @example 1280
|
|
128
|
+
*/
|
|
129
|
+
width: number;
|
|
130
|
+
/**
|
|
131
|
+
* Controls if the related youtube videos at the end are from the same channel.
|
|
132
|
+
* @default 1
|
|
133
|
+
* @example 0
|
|
134
|
+
*/
|
|
135
|
+
rel: number;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The options for setting a youtube video.
|
|
139
|
+
*/
|
|
140
|
+
type SetYoutubeVideoOptions = {
|
|
141
|
+
src: string;
|
|
142
|
+
width?: number;
|
|
143
|
+
height?: number;
|
|
144
|
+
start?: number;
|
|
145
|
+
};
|
|
146
|
+
declare module '@tiptap/core' {
|
|
147
|
+
interface Commands<ReturnType> {
|
|
148
|
+
youtube: {
|
|
149
|
+
/**
|
|
150
|
+
* Insert a youtube video
|
|
151
|
+
* @param options The youtube video attributes
|
|
152
|
+
* @example editor.commands.setYoutubeVideo({ src: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ' })
|
|
153
|
+
*/
|
|
154
|
+
setYoutubeVideo: (options: SetYoutubeVideoOptions) => ReturnType;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* This extension adds support for youtube videos.
|
|
160
|
+
* @see https://www.tiptap.dev/api/nodes/youtube
|
|
161
|
+
*/
|
|
162
|
+
declare const Youtube: Node<YoutubeOptions, any>;
|
|
163
|
+
|
|
164
|
+
export { Youtube, type YoutubeOptions, Youtube as default };
|
package/dist/index.js
CHANGED
|
@@ -1,194 +1,240 @@
|
|
|
1
|
-
|
|
1
|
+
// src/youtube.ts
|
|
2
|
+
import { mergeAttributes, Node, nodePasteRule } from "@tiptap/core";
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
// src/utils.ts
|
|
5
|
+
var YOUTUBE_REGEX = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/;
|
|
6
|
+
var YOUTUBE_REGEX_GLOBAL = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g;
|
|
7
|
+
var isValidYoutubeUrl = (url) => {
|
|
8
|
+
return url.match(YOUTUBE_REGEX);
|
|
7
9
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
var getYoutubeEmbedUrl = (nocookie, isPlaylist) => {
|
|
11
|
+
if (isPlaylist) {
|
|
12
|
+
return "https://www.youtube-nocookie.com/embed/videoseries?list=";
|
|
13
|
+
}
|
|
14
|
+
return nocookie ? "https://www.youtube-nocookie.com/embed/" : "https://www.youtube.com/embed/";
|
|
13
15
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
if (ccLoadPolicy) {
|
|
48
|
-
params.push('cc_load_policy=1');
|
|
49
|
-
}
|
|
50
|
-
if (!controls) {
|
|
51
|
-
params.push('controls=0');
|
|
52
|
-
}
|
|
53
|
-
if (disableKBcontrols) {
|
|
54
|
-
params.push('disablekb=1');
|
|
55
|
-
}
|
|
56
|
-
if (enableIFrameApi) {
|
|
57
|
-
params.push('enablejsapi=1');
|
|
58
|
-
}
|
|
59
|
-
if (endTime) {
|
|
60
|
-
params.push(`end=${endTime}`);
|
|
61
|
-
}
|
|
62
|
-
if (interfaceLanguage) {
|
|
63
|
-
params.push(`hl=${interfaceLanguage}`);
|
|
16
|
+
var getEmbedUrlFromYoutubeUrl = (options) => {
|
|
17
|
+
const {
|
|
18
|
+
url,
|
|
19
|
+
allowFullscreen,
|
|
20
|
+
autoplay,
|
|
21
|
+
ccLanguage,
|
|
22
|
+
ccLoadPolicy,
|
|
23
|
+
controls,
|
|
24
|
+
disableKBcontrols,
|
|
25
|
+
enableIFrameApi,
|
|
26
|
+
endTime,
|
|
27
|
+
interfaceLanguage,
|
|
28
|
+
ivLoadPolicy,
|
|
29
|
+
loop,
|
|
30
|
+
modestBranding,
|
|
31
|
+
nocookie,
|
|
32
|
+
origin,
|
|
33
|
+
playlist,
|
|
34
|
+
progressBarColor,
|
|
35
|
+
startAt,
|
|
36
|
+
rel
|
|
37
|
+
} = options;
|
|
38
|
+
if (!isValidYoutubeUrl(url)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (url.includes("/embed/")) {
|
|
42
|
+
return url;
|
|
43
|
+
}
|
|
44
|
+
if (url.includes("youtu.be")) {
|
|
45
|
+
const id = url.split("/").pop();
|
|
46
|
+
if (!id) {
|
|
47
|
+
return null;
|
|
64
48
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
49
|
+
return `${getYoutubeEmbedUrl(nocookie)}${id}`;
|
|
50
|
+
}
|
|
51
|
+
const videoIdRegex = /(?:(v|list)=|shorts\/)([-\w]+)/gm;
|
|
52
|
+
const matches = videoIdRegex.exec(url);
|
|
53
|
+
if (!matches || !matches[2]) {
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
let outputUrl = `${getYoutubeEmbedUrl(nocookie, matches[1] === "list")}${matches[2]}`;
|
|
57
|
+
const params = [];
|
|
58
|
+
if (allowFullscreen === false) {
|
|
59
|
+
params.push("fs=0");
|
|
60
|
+
}
|
|
61
|
+
if (autoplay) {
|
|
62
|
+
params.push("autoplay=1");
|
|
63
|
+
}
|
|
64
|
+
if (ccLanguage) {
|
|
65
|
+
params.push(`cc_lang_pref=${ccLanguage}`);
|
|
66
|
+
}
|
|
67
|
+
if (ccLoadPolicy) {
|
|
68
|
+
params.push("cc_load_policy=1");
|
|
69
|
+
}
|
|
70
|
+
if (!controls) {
|
|
71
|
+
params.push("controls=0");
|
|
72
|
+
}
|
|
73
|
+
if (disableKBcontrols) {
|
|
74
|
+
params.push("disablekb=1");
|
|
75
|
+
}
|
|
76
|
+
if (enableIFrameApi) {
|
|
77
|
+
params.push("enablejsapi=1");
|
|
78
|
+
}
|
|
79
|
+
if (endTime) {
|
|
80
|
+
params.push(`end=${endTime}`);
|
|
81
|
+
}
|
|
82
|
+
if (interfaceLanguage) {
|
|
83
|
+
params.push(`hl=${interfaceLanguage}`);
|
|
84
|
+
}
|
|
85
|
+
if (ivLoadPolicy) {
|
|
86
|
+
params.push(`iv_load_policy=${ivLoadPolicy}`);
|
|
87
|
+
}
|
|
88
|
+
if (loop) {
|
|
89
|
+
params.push("loop=1");
|
|
90
|
+
}
|
|
91
|
+
if (modestBranding) {
|
|
92
|
+
params.push("modestbranding=1");
|
|
93
|
+
}
|
|
94
|
+
if (origin) {
|
|
95
|
+
params.push(`origin=${origin}`);
|
|
96
|
+
}
|
|
97
|
+
if (playlist) {
|
|
98
|
+
params.push(`playlist=${playlist}`);
|
|
99
|
+
}
|
|
100
|
+
if (startAt) {
|
|
101
|
+
params.push(`start=${startAt}`);
|
|
102
|
+
}
|
|
103
|
+
if (progressBarColor) {
|
|
104
|
+
params.push(`color=${progressBarColor}`);
|
|
105
|
+
}
|
|
106
|
+
if (rel !== void 0) {
|
|
107
|
+
params.push(`rel=${rel}`);
|
|
108
|
+
}
|
|
109
|
+
if (params.length) {
|
|
110
|
+
outputUrl += `${matches[1] === "v" ? "?" : "&"}${params.join("&")}`;
|
|
111
|
+
}
|
|
112
|
+
return outputUrl;
|
|
93
113
|
};
|
|
94
114
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
setYoutubeVideo: (options) => ({ commands }) => {
|
|
160
|
-
if (!isValidYoutubeUrl(options.src)) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
return commands.insertContent({
|
|
164
|
-
type: this.name,
|
|
165
|
-
attrs: options,
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
addPasteRules() {
|
|
171
|
-
if (!this.options.addPasteHandler) {
|
|
172
|
-
return [];
|
|
115
|
+
// src/youtube.ts
|
|
116
|
+
var Youtube = Node.create({
|
|
117
|
+
name: "youtube",
|
|
118
|
+
addOptions() {
|
|
119
|
+
return {
|
|
120
|
+
addPasteHandler: true,
|
|
121
|
+
allowFullscreen: true,
|
|
122
|
+
autoplay: false,
|
|
123
|
+
ccLanguage: void 0,
|
|
124
|
+
ccLoadPolicy: void 0,
|
|
125
|
+
controls: true,
|
|
126
|
+
disableKBcontrols: false,
|
|
127
|
+
enableIFrameApi: false,
|
|
128
|
+
endTime: 0,
|
|
129
|
+
height: 480,
|
|
130
|
+
interfaceLanguage: void 0,
|
|
131
|
+
ivLoadPolicy: 0,
|
|
132
|
+
loop: false,
|
|
133
|
+
modestBranding: false,
|
|
134
|
+
HTMLAttributes: {},
|
|
135
|
+
inline: false,
|
|
136
|
+
nocookie: false,
|
|
137
|
+
origin: "",
|
|
138
|
+
playlist: "",
|
|
139
|
+
progressBarColor: void 0,
|
|
140
|
+
width: 640,
|
|
141
|
+
rel: 1
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
inline() {
|
|
145
|
+
return this.options.inline;
|
|
146
|
+
},
|
|
147
|
+
group() {
|
|
148
|
+
return this.options.inline ? "inline" : "block";
|
|
149
|
+
},
|
|
150
|
+
draggable: true,
|
|
151
|
+
addAttributes() {
|
|
152
|
+
return {
|
|
153
|
+
src: {
|
|
154
|
+
default: null
|
|
155
|
+
},
|
|
156
|
+
start: {
|
|
157
|
+
default: 0
|
|
158
|
+
},
|
|
159
|
+
width: {
|
|
160
|
+
default: this.options.width
|
|
161
|
+
},
|
|
162
|
+
height: {
|
|
163
|
+
default: this.options.height
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
},
|
|
167
|
+
parseHTML() {
|
|
168
|
+
return [
|
|
169
|
+
{
|
|
170
|
+
tag: "div[data-youtube-video] iframe"
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
},
|
|
174
|
+
addCommands() {
|
|
175
|
+
return {
|
|
176
|
+
setYoutubeVideo: (options) => ({ commands }) => {
|
|
177
|
+
if (!isValidYoutubeUrl(options.src)) {
|
|
178
|
+
return false;
|
|
173
179
|
}
|
|
174
|
-
return
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
180
|
+
return commands.insertContent({
|
|
181
|
+
type: this.name,
|
|
182
|
+
attrs: options
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
},
|
|
187
|
+
addPasteRules() {
|
|
188
|
+
if (!this.options.addPasteHandler) {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
return [
|
|
192
|
+
nodePasteRule({
|
|
193
|
+
find: YOUTUBE_REGEX_GLOBAL,
|
|
194
|
+
type: this.type,
|
|
195
|
+
getAttributes: (match) => {
|
|
196
|
+
return { src: match.input };
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
];
|
|
200
|
+
},
|
|
201
|
+
renderHTML({ HTMLAttributes }) {
|
|
202
|
+
const embedUrl = getEmbedUrlFromYoutubeUrl({
|
|
203
|
+
url: HTMLAttributes.src,
|
|
204
|
+
allowFullscreen: this.options.allowFullscreen,
|
|
205
|
+
autoplay: this.options.autoplay,
|
|
206
|
+
ccLanguage: this.options.ccLanguage,
|
|
207
|
+
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
208
|
+
controls: this.options.controls,
|
|
209
|
+
disableKBcontrols: this.options.disableKBcontrols,
|
|
210
|
+
enableIFrameApi: this.options.enableIFrameApi,
|
|
211
|
+
endTime: this.options.endTime,
|
|
212
|
+
interfaceLanguage: this.options.interfaceLanguage,
|
|
213
|
+
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
214
|
+
loop: this.options.loop,
|
|
215
|
+
modestBranding: this.options.modestBranding,
|
|
216
|
+
nocookie: this.options.nocookie,
|
|
217
|
+
origin: this.options.origin,
|
|
218
|
+
playlist: this.options.playlist,
|
|
219
|
+
progressBarColor: this.options.progressBarColor,
|
|
220
|
+
startAt: HTMLAttributes.start || 0,
|
|
221
|
+
rel: this.options.rel
|
|
222
|
+
});
|
|
223
|
+
HTMLAttributes.src = embedUrl;
|
|
224
|
+
return [
|
|
225
|
+
"div",
|
|
226
|
+
{ "data-youtube-video": "" },
|
|
227
|
+
[
|
|
228
|
+
"iframe",
|
|
229
|
+
mergeAttributes(
|
|
230
|
+
this.options.HTMLAttributes,
|
|
231
|
+
{
|
|
232
|
+
width: this.options.width,
|
|
233
|
+
height: this.options.height,
|
|
234
|
+
allowfullscreen: this.options.allowFullscreen,
|
|
188
235
|
autoplay: this.options.autoplay,
|
|
189
236
|
ccLanguage: this.options.ccLanguage,
|
|
190
237
|
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
191
|
-
controls: this.options.controls,
|
|
192
238
|
disableKBcontrols: this.options.disableKBcontrols,
|
|
193
239
|
enableIFrameApi: this.options.enableIFrameApi,
|
|
194
240
|
endTime: this.options.endTime,
|
|
@@ -196,42 +242,22 @@ const Youtube = Node.create({
|
|
|
196
242
|
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
197
243
|
loop: this.options.loop,
|
|
198
244
|
modestBranding: this.options.modestBranding,
|
|
199
|
-
nocookie: this.options.nocookie,
|
|
200
245
|
origin: this.options.origin,
|
|
201
246
|
playlist: this.options.playlist,
|
|
202
247
|
progressBarColor: this.options.progressBarColor,
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
[
|
|
211
|
-
'iframe',
|
|
212
|
-
mergeAttributes(this.options.HTMLAttributes, {
|
|
213
|
-
width: this.options.width,
|
|
214
|
-
height: this.options.height,
|
|
215
|
-
allowfullscreen: this.options.allowFullscreen,
|
|
216
|
-
autoplay: this.options.autoplay,
|
|
217
|
-
ccLanguage: this.options.ccLanguage,
|
|
218
|
-
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
219
|
-
disableKBcontrols: this.options.disableKBcontrols,
|
|
220
|
-
enableIFrameApi: this.options.enableIFrameApi,
|
|
221
|
-
endTime: this.options.endTime,
|
|
222
|
-
interfaceLanguage: this.options.interfaceLanguage,
|
|
223
|
-
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
224
|
-
loop: this.options.loop,
|
|
225
|
-
modestBranding: this.options.modestBranding,
|
|
226
|
-
origin: this.options.origin,
|
|
227
|
-
playlist: this.options.playlist,
|
|
228
|
-
progressBarColor: this.options.progressBarColor,
|
|
229
|
-
rel: this.options.rel,
|
|
230
|
-
}, HTMLAttributes),
|
|
231
|
-
],
|
|
232
|
-
];
|
|
233
|
-
},
|
|
248
|
+
rel: this.options.rel
|
|
249
|
+
},
|
|
250
|
+
HTMLAttributes
|
|
251
|
+
)
|
|
252
|
+
]
|
|
253
|
+
];
|
|
254
|
+
}
|
|
234
255
|
});
|
|
235
256
|
|
|
236
|
-
|
|
237
|
-
|
|
257
|
+
// src/index.ts
|
|
258
|
+
var index_default = Youtube;
|
|
259
|
+
export {
|
|
260
|
+
Youtube,
|
|
261
|
+
index_default as default
|
|
262
|
+
};
|
|
263
|
+
//# sourceMappingURL=index.js.map
|