multi_embed_player 3.0.1 → 3.1.0
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/.github/workflows/build-and-deploy.yml +44 -0
- package/.gitmodules +3 -0
- package/CLAUDE.md +92 -0
- package/README.md +0 -24
- package/add_types.sh +61 -0
- package/browserExtention/chrome/background.js +55 -0
- package/browserExtention/chrome/extention.json +1 -0
- package/browserExtention/chrome/liteplayer.js +26439 -0
- package/browserExtention/chrome/manifest.json +31 -0
- package/browserExtention/chrome/player-selector.js +1854 -0
- package/browserExtention/firefox/background.js +27 -0
- package/browserExtention/firefox/extention.json +1 -0
- package/browserExtention/firefox/liteplayer.js +26439 -0
- package/browserExtention/firefox/manifest.json +19 -0
- package/browserExtention/firefox/player-selector.js +1854 -0
- package/documents/.hugo_build.lock +0 -0
- package/documents/archetypes/default.md +5 -0
- package/documents/assets/jsconfig.json +11 -0
- package/documents/content/docs/install.md +103 -0
- package/documents/content/docs/quickstart.md +51 -0
- package/documents/content/docs/reference/HTML.md +31 -0
- package/documents/content/docs/reference/_index.md +10 -0
- package/documents/content/docs/reference/error_code.md +23 -0
- package/documents/content/docs/reference/iframe_api.md +737 -0
- package/documents/content/docs/reference/iframe_class.md +230 -0
- package/documents/content/docs/reference/multi_embed_player_class.md +113 -0
- package/documents/content/docs/reference/reserved_words.md +71 -0
- package/documents/content/docs/usage/GDPR_mode.md +77 -0
- package/documents/content/docs/usage/_index.md +10 -0
- package/documents/content/docs/usage/custom_playlist.md +239 -0
- package/documents/content/docs/usage/embed_api.md +163 -0
- package/documents/content/docs/usage/embed_various_service.md +81 -0
- package/documents/content/docs/usage/thumbnail_click.md +57 -0
- package/documents/go.mod +8 -0
- package/documents/go.sum +14 -0
- package/documents/hugo.toml +18 -0
- package/documents/layouts/partials/docs/sidebar.html +117 -0
- package/documents/layouts/partials/landing/features.html +47 -0
- package/documents/layouts/robots.txt +4 -0
- package/documents/static/_headers +7 -0
- package/documents/static/localStorageCheck.html +27 -0
- package/documents/static/no_extention.json +1 -0
- package/example.html +27 -0
- package/extention.json +1 -0
- package/icon/video_not_found.odg +0 -0
- package/icon/video_not_found.svgz +0 -0
- package/iframe_api/bilibili.ts +1095 -0
- package/iframe_api/niconico.ts +429 -0
- package/iframe_api/soundcloud.ts +450 -0
- package/iframe_api/youtube.ts +311 -0
- package/multi_embed_player.ts +989 -0
- package/package.json +10 -41
- package/player_api_gate/bilibili-api-gate/cgi/cpp/bilibili-api-gate-cgi.cpp +281 -0
- package/player_api_gate/bilibili-api-gate/cgi/go/src.go +46 -0
- package/player_api_gate/bilibili-api-gate/cloudflare_workers/package-lock.json +1356 -0
- package/player_api_gate/bilibili-api-gate/cloudflare_workers/package.json +12 -0
- package/player_api_gate/bilibili-api-gate/cloudflare_workers/src/index.js +50 -0
- package/player_api_gate/bilibili-api-gate/cloudflare_workers/wrangler.toml +3 -0
- package/player_api_gate/iframe-api-ts/.editorconfig +12 -0
- package/player_api_gate/iframe-api-ts/.prettierrc +6 -0
- package/player_api_gate/iframe-api-ts/package-lock.json +3054 -0
- package/player_api_gate/iframe-api-ts/package.json +18 -0
- package/player_api_gate/iframe-api-ts/src/bilibili.ts +49 -0
- package/player_api_gate/iframe-api-ts/src/index.ts +35 -0
- package/player_api_gate/iframe-api-ts/src/niconico.ts +95 -0
- package/player_api_gate/iframe-api-ts/src/soundcloud.ts +38 -0
- package/player_api_gate/iframe-api-ts/src/types.ts +115 -0
- package/player_api_gate/iframe-api-ts/src/url-proxy.ts +29 -0
- package/player_api_gate/iframe-api-ts/src/utils.ts +82 -0
- package/player_api_gate/iframe-api-ts/src/youtube.ts +41 -0
- package/player_api_gate/iframe-api-ts/test/bilibili.spec.ts +47 -0
- package/player_api_gate/iframe-api-ts/test/env.d.ts +3 -0
- package/player_api_gate/iframe-api-ts/test/index.spec.ts +59 -0
- package/player_api_gate/iframe-api-ts/test/niconico.spec.ts +55 -0
- package/player_api_gate/iframe-api-ts/test/soundcloud.spec.ts +55 -0
- package/player_api_gate/iframe-api-ts/test/tsconfig.json +8 -0
- package/player_api_gate/iframe-api-ts/test/url-proxy.spec.ts +46 -0
- package/player_api_gate/iframe-api-ts/test/youtube.spec.ts +45 -0
- package/player_api_gate/iframe-api-ts/tsconfig.json +45 -0
- package/player_api_gate/iframe-api-ts/vitest.config.mts +11 -0
- package/player_api_gate/iframe-api-ts/worker-configuration.d.ts +5768 -0
- package/player_api_gate/iframe-api-ts/wrangler.jsonc +47 -0
- package/player_api_gate/iframe_api/.editorconfig +13 -0
- package/player_api_gate/iframe_api/.prettierrc +6 -0
- package/player_api_gate/iframe_api/package-lock.json +1307 -0
- package/player_api_gate/iframe_api/package.json +12 -0
- package/player_api_gate/iframe_api/src/bilibili_api.js +60 -0
- package/player_api_gate/iframe_api/src/index.js +47 -0
- package/player_api_gate/iframe_api/src/niconico_api.js +112 -0
- package/player_api_gate/iframe_api/src/soundcloud_api.js +57 -0
- package/player_api_gate/iframe_api/src/url_proxy.js +28 -0
- package/player_api_gate/iframe_api/src/youtube_api.js +44 -0
- package/player_api_gate/iframe_api/wrangler.toml +51 -0
- package/player_api_gate/niconico-imager/cgi/go/src.go +74 -0
- package/player_api_gate/niconico-imager/cloudflare_workers/package-lock.json +2175 -0
- package/player_api_gate/niconico-imager/cloudflare_workers/package.json +12 -0
- package/player_api_gate/niconico-imager/cloudflare_workers/src/index.js +78 -0
- package/player_api_gate/niconico-imager/cloudflare_workers/wrangler.toml +3 -0
- package/test_script.html +172 -0
- package/tsconfig.json +36 -0
- package/dist/iframe_api/bilibili.d.ts +0 -91
- package/dist/iframe_api/bilibili.d.ts.map +0 -1
- package/dist/iframe_api/bilibili.js +0 -451
- package/dist/iframe_api/bilibili.js.map +0 -1
- package/dist/iframe_api/index.d.ts +0 -6
- package/dist/iframe_api/index.d.ts.map +0 -1
- package/dist/iframe_api/index.js +0 -8
- package/dist/iframe_api/index.js.map +0 -1
- package/dist/iframe_api/niconico.d.ts +0 -42
- package/dist/iframe_api/niconico.d.ts.map +0 -1
- package/dist/iframe_api/niconico.js +0 -181
- package/dist/iframe_api/niconico.js.map +0 -1
- package/dist/iframe_api/soundcloud.d.ts +0 -80
- package/dist/iframe_api/soundcloud.d.ts.map +0 -1
- package/dist/iframe_api/soundcloud.js +0 -188
- package/dist/iframe_api/soundcloud.js.map +0 -1
- package/dist/iframe_api/youtube.d.ts +0 -133
- package/dist/iframe_api/youtube.d.ts.map +0 -1
- package/dist/iframe_api/youtube.js +0 -278
- package/dist/iframe_api/youtube.js.map +0 -1
- package/dist/multi_embed_player.d.ts +0 -48
- package/dist/multi_embed_player.d.ts.map +0 -1
- package/dist/multi_embed_player.js +0 -318
- package/dist/multi_embed_player.js.map +0 -1
- package/dist/types.d.ts +0 -126
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 5200
|
|
3
|
+
title: "Iframe_class"
|
|
4
|
+
description: ""
|
|
5
|
+
icon: "article"
|
|
6
|
+
date: "2023-11-04T18:33:04+09:00"
|
|
7
|
+
lastmod: "2023-11-04T18:33:04+09:00"
|
|
8
|
+
draft: false
|
|
9
|
+
toc: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## common object
|
|
13
|
+
|
|
14
|
+
### Load_video_option_object
|
|
15
|
+
|
|
16
|
+
{{< table "table-responsive" >}}
|
|
17
|
+
|
|
18
|
+
|variable name|type|require|default value|description|
|
|
19
|
+
|---|---|---|---|---|
|
|
20
|
+
|videoId|string|true||video id for player|
|
|
21
|
+
|startSeconds|number|false|0|start seconds for player|
|
|
22
|
+
|endSeconds|number|false||end seconds for player|
|
|
23
|
+
|
|
24
|
+
{{< /table >}}
|
|
25
|
+
|
|
26
|
+
### player_content_object
|
|
27
|
+
|
|
28
|
+
{{< table "table-responsive" >}}
|
|
29
|
+
|
|
30
|
+
|variable name|type|require|default value|description|
|
|
31
|
+
|---|---|---|---|---|
|
|
32
|
+
|videoId|string|true||video id for player|
|
|
33
|
+
|startSeconds|number|false|0|start seconds for player|
|
|
34
|
+
|endSeconds|number|false||end seconds for player|
|
|
35
|
+
|playerVars|Object{urlparameter:value}|false|{}|player vars for player|
|
|
36
|
+
|width|number|true||width for player|
|
|
37
|
+
|height|number|true||height for player|
|
|
38
|
+
|
|
39
|
+
{{< /table >}}
|
|
40
|
+
|
|
41
|
+
## common event
|
|
42
|
+
|
|
43
|
+
{{< table "table-responsive" >}}
|
|
44
|
+
|
|
45
|
+
| Event Name | Type | Description | value |
|
|
46
|
+
|------------|------|-------------|-------|
|
|
47
|
+
| `onReady` | Event | Fired when the player is ready | None |
|
|
48
|
+
| `onError` | CustomEvent | Fired when an error occurs | [Error code](/docs/reference/error_code) |
|
|
49
|
+
| `onStateChange` | CustomEvent | Fired when the player's state changes | player state |
|
|
50
|
+
| `onEndVideo` | Event | Fired when the video playback ends | None |
|
|
51
|
+
| `executeSecound` | Event | Fired to trigger secondary action (error handling) | None |
|
|
52
|
+
|
|
53
|
+
{{< /table >}}
|
|
54
|
+
|
|
55
|
+
## mep_niconico class
|
|
56
|
+
|
|
57
|
+
defined at [niconico.js](https://github.com/bonjinnorenka/multi_embed_player/blob/main/iframe_api/niconico.js)
|
|
58
|
+
|
|
59
|
+
### variable list
|
|
60
|
+
|
|
61
|
+
{{< table "table-responsive" >}}
|
|
62
|
+
|
|
63
|
+
|variable name|type|default value|description|
|
|
64
|
+
|---|---|---|---|
|
|
65
|
+
|playerId|number|0|player id for detect iframe|
|
|
66
|
+
|origin|string|https://embed.nicovideo.jp|iframe origin|
|
|
67
|
+
|localStorageCheck|null or boolean|null|localStorage check result **compatibility**|
|
|
68
|
+
|
|
69
|
+
{{< /table >}}
|
|
70
|
+
|
|
71
|
+
### function list
|
|
72
|
+
|
|
73
|
+
{{< table "table-responsive" >}}
|
|
74
|
+
|
|
75
|
+
|function name|arguments|response|description|
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
|constructor|replacing_element:Node Or String(dom id),player_content_object,player_set_event_function:function||constructor of class|
|
|
78
|
+
|cueVideoById|Load_video_option_object||cue video by id for player|
|
|
79
|
+
|loadVideoById|Load_video_option_object||load video by id for player|
|
|
80
|
+
|getRealDuration||number(seconds)|return duration between start and end seconds|
|
|
81
|
+
|playVideo|||play video for player|
|
|
82
|
+
|pauseVideo|||pause video for player|
|
|
83
|
+
|getCurrentTime||number(seconds)|get curent time for player|
|
|
84
|
+
|getDuration||number(seconds)|get duration for player|
|
|
85
|
+
|getTitle||string|get title for playing video|
|
|
86
|
+
|isMuted||boolean|check mute status for player|
|
|
87
|
+
|getVolume||number(0-100)|get volume for player|
|
|
88
|
+
|seekTo|number(seconds)||seek to time for player|
|
|
89
|
+
|displayComment|boolean||display comment for player|
|
|
90
|
+
|mute|||mute for player|
|
|
91
|
+
|unMute|||unmute for player|
|
|
92
|
+
|setVolume|number(0-100)||set volume for player|
|
|
93
|
+
|getPlayerState||number|get player state<br>0->not playing only thumbnail<br>1->onloaded(include cue)<br>2->playing<br>3->paused<br>4->video ended
|
|
94
|
+
|
|
95
|
+
{{< /table >}}
|
|
96
|
+
|
|
97
|
+
## mep_bilibili class
|
|
98
|
+
|
|
99
|
+
defined at [bilibili.js](https://github.com/bonjinnorenka/multi_embed_player/blob/main/iframe_api/bilibili.js)
|
|
100
|
+
|
|
101
|
+
### variable list
|
|
102
|
+
|
|
103
|
+
{{< table "table-responsive" >}}
|
|
104
|
+
|
|
105
|
+
|variable name|type|default value|description|
|
|
106
|
+
|---|---|---|---|
|
|
107
|
+
|localStorageCheck|null or boolean|null|localStorage check result|
|
|
108
|
+
| mep_extention_bilibili| boolean |false| extention mode|
|
|
109
|
+
| api_endpoint| string |https://iframe_api.ryokuryu.workers.dev| api endpoint you must change it or set cors proxy|
|
|
110
|
+
| no_extention_error| string | "No extention error description"| error message when extention is not found|
|
|
111
|
+
| player_base_url| string | ""| base url for player it will auto select|
|
|
112
|
+
|bilibili_api_cache|Object{videoId:video_info}|{}|cache for bilibili api|
|
|
113
|
+
| cors_proxy | string | "" | cors proxy endpoint|
|
|
114
|
+
|
|
115
|
+
{{< /table >}}
|
|
116
|
+
|
|
117
|
+
### function list
|
|
118
|
+
|
|
119
|
+
{{< table "table-responsive" >}}
|
|
120
|
+
|
|
121
|
+
|function name|arguments|response|description|
|
|
122
|
+
|---|---|---|---|
|
|
123
|
+
|constructor|replacing_element:Node Or String(dom id),player_content_object,player_set_event_function:function||constructor of class|
|
|
124
|
+
|cueVideoById|Load_video_option_object||cue video by id for player|
|
|
125
|
+
|loadVideoById|Load_video_option_object||load video by id for player|
|
|
126
|
+
| getCurrentTime | | number(seconds) | get curent time for player |
|
|
127
|
+
|playVideo|||play video for player|
|
|
128
|
+
|pauseVideo|||pause video for player|
|
|
129
|
+
|seekTo|number(seconds)||seek to time for player|
|
|
130
|
+
|getRealDuration||promise number(seconds) if no extention|return duration between start and end seconds|
|
|
131
|
+
|getDuration||promise number(seconds) if no extention|get duration for player|
|
|
132
|
+
|getTitle||promise string if no extention|get title for playing video|
|
|
133
|
+
|getPlayerState||promise number|get player state<br>0->not playing only thumbnail<br>1->onloaded(include cue)<br>2->playing<br>3->paused<br>4->video ended
|
|
134
|
+
|setVolume|number(0-100)||set volume for player **not working if no extention**|
|
|
135
|
+
|getVolume||number(0-100)|get volume for player **not working if no extention**|
|
|
136
|
+
|isMuted||boolean|check mute status for player **not working if no extention**|
|
|
137
|
+
|mute|||mute for player **not working if no extention**|
|
|
138
|
+
|unMute|||unmute for player **not working if no extention**|
|
|
139
|
+
|displayComment|boolean||display comment for player **not working if no extention**|
|
|
140
|
+
|
|
141
|
+
{{< /table >}}
|
|
142
|
+
|
|
143
|
+
## mep_soundcloud class
|
|
144
|
+
|
|
145
|
+
defined at [soundcloud.js](https://github.com/bonjinnorenka/multi_embed_player/blob/main/iframe_api/soundcloud.js)
|
|
146
|
+
|
|
147
|
+
### variable list
|
|
148
|
+
|
|
149
|
+
{{< table "table-responsive" >}}
|
|
150
|
+
|
|
151
|
+
|variable name|type|default value|description|
|
|
152
|
+
|---|---|---|---|
|
|
153
|
+
|soundcloud_api_loaded|boolean or null|null|soundcloud api loaded status|
|
|
154
|
+
|soundcloud_api_promise|Array of function|[]|after load soundcloud api call this functions|
|
|
155
|
+
|numericRegex|RegExp|/^[0-9]+$/|numeric regex|
|
|
156
|
+
|
|
157
|
+
{{< /table >}}
|
|
158
|
+
|
|
159
|
+
### function list
|
|
160
|
+
|
|
161
|
+
{{< table "table-responsive" >}}
|
|
162
|
+
|
|
163
|
+
|function name|arguments|response|description|
|
|
164
|
+
|---|---|---|---|
|
|
165
|
+
|constructor|replacing_element:Node Or String(dom id),player_content_object,player_set_event_function:function||constructor of class|
|
|
166
|
+
|playVideo|||play video for player|
|
|
167
|
+
|pauseVideo|||pause video for player|
|
|
168
|
+
|getCurrentTime||number(seconds)|get curent time for player|
|
|
169
|
+
|getDuration||number(seconds)|get duration for player|
|
|
170
|
+
|seekTo|number(seconds)||seek to time for player|
|
|
171
|
+
|setVolume|number(0-100)||set volume for player|
|
|
172
|
+
|mute|||mute for player|
|
|
173
|
+
|unMute|||unmute for player|
|
|
174
|
+
|isMuted||boolean|check mute status for player|
|
|
175
|
+
|getVolume||number(0-100)|get volume for player|
|
|
176
|
+
|getPlayerState||number|get player state<br>0->not playing only thumbnail<br>1->onloaded(include cue)<br>2->playing<br>3->paused<br>4->video ended|
|
|
177
|
+
|getTitle||string|get title for playing video|
|
|
178
|
+
|loadVideoById|Load_video_option_object||load video by id for player|
|
|
179
|
+
|cueVideoById|Load_video_option_object||cue video by id for player|
|
|
180
|
+
|getRealDuration||number(seconds)|return duration between start and end seconds|
|
|
181
|
+
|
|
182
|
+
{{< /table >}}
|
|
183
|
+
|
|
184
|
+
## mep_youtube class
|
|
185
|
+
|
|
186
|
+
defined at [youtube.js](https://github.com/bonjinnorenka/multi_embed_player/blob/main/iframe_api/youtube.js)
|
|
187
|
+
|
|
188
|
+
### variable list
|
|
189
|
+
|
|
190
|
+
{{< table "table-responsive" >}}
|
|
191
|
+
|
|
192
|
+
|variable name|type|default value|description|
|
|
193
|
+
|---|---|---|---|
|
|
194
|
+
|youtube_api_loaded|number|0|YouTube API loaded status (0: not loaded, 1: loading, 2: loaded)|
|
|
195
|
+
|youtube_api_promise|Array of function|[]|Functions to call after loading YouTube API|
|
|
196
|
+
|
|
197
|
+
{{< /table >}}
|
|
198
|
+
|
|
199
|
+
### function list
|
|
200
|
+
|
|
201
|
+
{{< table "table-responsive" >}}
|
|
202
|
+
|
|
203
|
+
|function name|arguments|response|description|
|
|
204
|
+
|---|---|---|---|
|
|
205
|
+
|constructor|replacing_element: Node Or String (dom id), content: mep_youtube_content, player_set_event_function: function||Constructor of class|
|
|
206
|
+
|playVideo|||Play video for player|
|
|
207
|
+
|pauseVideo|||Pause video for player|
|
|
208
|
+
|getCurrentTime||number (seconds)|Get current time of video|
|
|
209
|
+
|getDuration||number (seconds)|Get duration of video|
|
|
210
|
+
|getRealDulation||number (seconds)|Get actual duration between start and end times|
|
|
211
|
+
|seekTo|time: number (seconds)||Seek to specified time in video|
|
|
212
|
+
|setVolume|volume: number (0-100)||Set volume for player|
|
|
213
|
+
|mute|||Mute player|
|
|
214
|
+
|unMute|||Unmute player|
|
|
215
|
+
|isMuted||boolean|Check mute status of player|
|
|
216
|
+
|getVolume||number (0-100)|Get volume of player|
|
|
217
|
+
|getPlayerState||number|Get player state<br>0->unstarted<br>1->buffering<br>2->playing<br>3->paused<br>4->ended|
|
|
218
|
+
|getTitle||string|Get title of current video|
|
|
219
|
+
|loadVideoById|content: mep_youtube_load_object or string, [startSeconds: number]||Load video by ID with autoplay|
|
|
220
|
+
|cueVideoById|content: mep_youtube_load_object or string, [startSeconds: number]||Cue video by ID without autoplay|
|
|
221
|
+
|
|
222
|
+
{{< /table >}}
|
|
223
|
+
|
|
224
|
+
## AI Assistance Disclosure
|
|
225
|
+
This documentation page includes content generated with the assistance of AI tools. Specifically:
|
|
226
|
+
|
|
227
|
+
Claude 3.5 Sonnet
|
|
228
|
+
GitHub Copilot
|
|
229
|
+
|
|
230
|
+
All AI-generated content has been reviewed and edited by a human to ensure accuracy and relevance.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 5100
|
|
3
|
+
title: "Multi_embed_player_class"
|
|
4
|
+
description: ""
|
|
5
|
+
icon: "article"
|
|
6
|
+
date: "2023-11-04T16:48:57+09:00"
|
|
7
|
+
lastmod: "2023-11-04T16:48:57+09:00"
|
|
8
|
+
draft: false
|
|
9
|
+
toc: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
Defined at [multi_embed_player.js](https://github.com/bonjinnorenka/multi_embed_player/blob/main/multi_embed_player.js)
|
|
13
|
+
|
|
14
|
+
## variable list of multi_embed_player class
|
|
15
|
+
|
|
16
|
+
{{< table "table-responsive" >}}
|
|
17
|
+
|
|
18
|
+
|variable name|type|default value|description|
|
|
19
|
+
|---|---|---|---|
|
|
20
|
+
|cors_proxy_url|string||cors proxy url|
|
|
21
|
+
|iframe_api_endpoint|string|https://iframe_api.ryokuryu.workers.dev|[iframe api endpoint](/docs/reference/iframe_api)|
|
|
22
|
+
|follow_GDPR|boolean|false|follow GDPR mode|
|
|
23
|
+
|script_origin|string|https://cdn.jsdelivr.net/npm/multi_embed_player@3/dist/|script origin|
|
|
24
|
+
|mep_status_load_api|Object|{serviceName:number}|load api status <br>0->not load<br>1->loading<br>2->loaded|
|
|
25
|
+
|mep_load_api_promise|Object|{serviceName:[function]}|waiting load api function<br>functions will be called when api loaded|
|
|
26
|
+
|api_cache|Object|{serviceName:{[iframe api response](/docs/reference/iframe_api)}}|api cache of iframe api response|
|
|
27
|
+
|GDPR_accept_promise|Object|{serviceName:[function]}|waiting GDPR accept function<br>functions will be called when GDPR accepted|
|
|
28
|
+
|iframe_api_class|Object|{}|iframe sub api class<br>add value after iframe sub api loaded|
|
|
29
|
+
|GDPR_accepted|Object|{serviceName:boolean}|GDPR accepted status|
|
|
30
|
+
|possible_direct_access_services|string[]|[servicename]|services that can be accessed directly when GDPR accepted|
|
|
31
|
+
|tearms_policy_service|string|{servicename:policy url}|tearms policy url for specific service|
|
|
32
|
+
|
|
33
|
+
{{< /table >}}
|
|
34
|
+
|
|
35
|
+
## function list of multi_embed_player class instance
|
|
36
|
+
|
|
37
|
+
Not include function start with '#'.
|
|
38
|
+
|
|
39
|
+
{{< table "table-responsive" >}}
|
|
40
|
+
|
|
41
|
+
|function name|arguments|response|description|
|
|
42
|
+
|---|---|---|---|
|
|
43
|
+
|connectedCallback|||called when custom element connected|
|
|
44
|
+
|loadVideoById|{loadVideoByIdOptions},autoplay:boolean(optional),sub:boolean(optional internal compatible)||load video by id for player|
|
|
45
|
+
|playVideo|||play video for player|
|
|
46
|
+
|pauseVideo|||pause video for player|
|
|
47
|
+
|stopVideo|||pause video for player **compatibility**|
|
|
48
|
+
|getcurentTime||bilibili->Promise of number(seconds) <br>others -> number(seconds)|get curent time for player|
|
|
49
|
+
|seekTo|number(seconds)||seek to time for player|
|
|
50
|
+
|mute|||mute for player|
|
|
51
|
+
|unMute|||unmute for player|
|
|
52
|
+
|isMuted||bilibili->promise of boolean<br>others->boolean|check mute status for player|
|
|
53
|
+
|setVolume|number(0-100)||set volume for player|
|
|
54
|
+
|getVolume||bilibili->promise of number(0-100)<br>others->number(0-100)|get volume for player|
|
|
55
|
+
|getDuration||bilibili->promise of number(seconds)<br>others->(seconds)|get duration for player|
|
|
56
|
+
|getRealDuration||bilibili->promise of number(seconds)<br>others->number(seconds)|return duration between start and end seconds|
|
|
57
|
+
|getRelativeCurrentTime||bilibili->promise of number(seconds)<br>others->number(seconds)|return current time count from start seconds|
|
|
58
|
+
|getPercentOfCurrentTime||bilibili->promise of number(seconds)<br>others->number(seconds)|return current time percent from dulation<br>NOTE:sometimes return over 100% value|
|
|
59
|
+
|relativeSeekTo_ct|number(seconds)||seek to time count from current secounds|
|
|
60
|
+
|relativeSeekTo_ss|number(seconds)||seek to time count from start secounds|
|
|
61
|
+
|getPlayerState||number|get player state<br>-1->not set video mainly before embed<br>0->not playing only thumbnail<br>1->onloaded(include cue)<br>2->playing<br>3->paused<br>4->video ended|
|
|
62
|
+
|
|
63
|
+
{{< /table >}}
|
|
64
|
+
|
|
65
|
+
## event list of multi_embed_player class
|
|
66
|
+
|
|
67
|
+
{{< table "table-responsive" >}}
|
|
68
|
+
|
|
69
|
+
| Event Name | Type | Description | value |
|
|
70
|
+
|------------|------|-------------|-------|
|
|
71
|
+
| `onReady` | Event | Fired when the player is ready | None |
|
|
72
|
+
| `onError` | CustomEvent | Fired when an error occurs | [Error code](/docs/reference/error_code) |
|
|
73
|
+
| `onStateChange` | CustomEvent | Fired when the player's state changes | player state |
|
|
74
|
+
| `onEndVideo` | Event | Fired when the video playback ends | None |
|
|
75
|
+
| `executeSecound` | Event | Fired to trigger secondary action (error handling) | None |
|
|
76
|
+
|
|
77
|
+
{{< /table >}}
|
|
78
|
+
|
|
79
|
+
### loadVideoByIdOptions
|
|
80
|
+
|
|
81
|
+
{{< table "table-responsive" >}}
|
|
82
|
+
|
|
83
|
+
|variable name|type|require|default value|description|
|
|
84
|
+
|---|---|---|---|---|
|
|
85
|
+
|videoId|string|true||video id if call array is defined this value is ignored and not required|
|
|
86
|
+
|service|string|true||service name if call array is defined this value is ignored not required|
|
|
87
|
+
|startSeconds|number|false|0|start seconds|
|
|
88
|
+
|endSeconds|number|false||end seconds|
|
|
89
|
+
|call_array|[call_video_object]|false||call array|
|
|
90
|
+
|call_array_index|number|false|0|call array index|
|
|
91
|
+
|subVideoId|string|false||sub video id **compatibility**|
|
|
92
|
+
|subService|string|false||sub service name **compatibility**|
|
|
93
|
+
|
|
94
|
+
{{< /table >}}
|
|
95
|
+
|
|
96
|
+
### call_video_object
|
|
97
|
+
|
|
98
|
+
{{< table "table-responsive" >}}
|
|
99
|
+
|
|
100
|
+
|variable name|type|require|default value|description|
|
|
101
|
+
|---|---|---|---|---|
|
|
102
|
+
|videoId|string|true||video id|
|
|
103
|
+
|service|string|true||service name|
|
|
104
|
+
|
|
105
|
+
{{< /table >}}
|
|
106
|
+
|
|
107
|
+
## AI Assistance Disclosure
|
|
108
|
+
This documentation page includes content generated with the assistance of AI tools. Specifically:
|
|
109
|
+
|
|
110
|
+
Claude 3.5 Sonnet
|
|
111
|
+
GitHub Copilot
|
|
112
|
+
|
|
113
|
+
All AI-generated content has been reviewed and edited by a human to ensure accuracy and relevance.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 10000
|
|
3
|
+
title: "Reserved_words"
|
|
4
|
+
description: ""
|
|
5
|
+
icon: "article"
|
|
6
|
+
date: "2023-11-04T18:11:44+09:00"
|
|
7
|
+
lastmod: "2023-11-04T18:11:44+09:00"
|
|
8
|
+
draft: false
|
|
9
|
+
toc: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
**multi_embed_player***
|
|
13
|
+
|
|
14
|
+
**mep_***
|
|
15
|
+
|
|
16
|
+
will be reserved words.
|
|
17
|
+
|
|
18
|
+
## HTML tag
|
|
19
|
+
|
|
20
|
+
{{< table "table-responsive" >}}
|
|
21
|
+
|
|
22
|
+
| tag name | description |
|
|
23
|
+
| --- | --- |
|
|
24
|
+
| multi-embed-player | main tag |
|
|
25
|
+
|
|
26
|
+
{{< /table >}}
|
|
27
|
+
|
|
28
|
+
## Javascript
|
|
29
|
+
|
|
30
|
+
{{< table "table-responsive" >}}
|
|
31
|
+
|
|
32
|
+
| variable name |type| description |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| multi_embed_player_set_variable | function | set variable for multi_embed_player |
|
|
35
|
+
| multi_embed_player_save_GDPR_status | function | save GDPR status |
|
|
36
|
+
| multi_embed_player_GDPR_reviever | function | recieve GDPR status |
|
|
37
|
+
| multi_embed_player_fetch_iframe_api | function | fetch iframe api |
|
|
38
|
+
| multi_embed_player | class | multi_embed_player class |
|
|
39
|
+
| mep_niconico | class | niconico iframe class |
|
|
40
|
+
| mep_bilibili | class | bilibili iframe class |
|
|
41
|
+
| mep_soundcloud | class | soundcloud iframe class |
|
|
42
|
+
| mep_youtube | class | youtube iframe class |
|
|
43
|
+
|
|
44
|
+
{{< /table >}}
|
|
45
|
+
|
|
46
|
+
## Local storage
|
|
47
|
+
|
|
48
|
+
{{< table "table-responsive" >}}
|
|
49
|
+
|
|
50
|
+
| key name | description |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| multi_embed_player_GDPR_accepted | save GDPR status |
|
|
53
|
+
|
|
54
|
+
{{< /table >}}
|
|
55
|
+
|
|
56
|
+
## Class name(CSS)
|
|
57
|
+
|
|
58
|
+
{{< table "table-responsive" >}}
|
|
59
|
+
|
|
60
|
+
| class name | description |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
|multi-embed-player-CSS|multi-embed-player tag default CSS|
|
|
63
|
+
|mep_youtube|youtube iframe default CSS|
|
|
64
|
+
|mep_niconico|niconico iframe default CSS|
|
|
65
|
+
|mep_bilibili|bilibili iframe default CSS|
|
|
66
|
+
|mep_soundcloud|soundcloud iframe default CSS|
|
|
67
|
+
|mep_bilibili_transparent|bilibili iframe transparent CSS(use for bilibili pause over wrap)|
|
|
68
|
+
|mep_load_animation|load animation CSS use for this defined or not|
|
|
69
|
+
|mep_loading_animation|loading animation CSS use bilibili loding animation|
|
|
70
|
+
|
|
71
|
+
{{< /table >}}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 999
|
|
3
|
+
title: "GDPR_mode"
|
|
4
|
+
description: ""
|
|
5
|
+
icon: "article"
|
|
6
|
+
date: "2023-11-04T13:30:29+09:00"
|
|
7
|
+
lastmod: "2023-11-04T13:30:29+09:00"
|
|
8
|
+
draft: false
|
|
9
|
+
toc: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Requirements for GDPR mode
|
|
13
|
+
|
|
14
|
+
- [iframe api or cors proxy](/docs/install).
|
|
15
|
+
- multi_embed_player.js not working in sub iframe api.
|
|
16
|
+
|
|
17
|
+
## How to turn on GDPR mode
|
|
18
|
+
|
|
19
|
+
### Enable GDPR mode in all player in HTML
|
|
20
|
+
|
|
21
|
+
You need to set `follow_GDPR` to `true` in `multi_embed_player_set_variable` function.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<!--before multi_embed_player.js script tag-->
|
|
25
|
+
<script type="text/javascript">
|
|
26
|
+
const multi_embed_player_set_variable = (classname)=>{
|
|
27
|
+
//if you want to use GDPR mode all player
|
|
28
|
+
classname.follow_GDPR = true;
|
|
29
|
+
|
|
30
|
+
//if you use iframe api
|
|
31
|
+
//classname.iframe_api_endpoint = "YOUR IFRAME API ENDPOINT LIKE https://iframe_api.ryokuryu.workers.dev";
|
|
32
|
+
|
|
33
|
+
//if you use cors proxy
|
|
34
|
+
//classname.cors_proxy_url = "YOUR CORS PROXY URL LIKE https://cors-anywhere.herokuapp.com";
|
|
35
|
+
}
|
|
36
|
+
</script>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Enable GDPR mode in specific player in HTML
|
|
40
|
+
|
|
41
|
+
You need to add attribute `follow_GDPR` to `true` in `multi_embed_player` tag.
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<multi-embed-player videoid="_NC_pqMt5rY" service="youtube" follow_GDPR="true"></multi-embed-player>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
<!--live demo of this code-->
|
|
48
|
+
<style>
|
|
49
|
+
multi-embed-player{
|
|
50
|
+
width: 480px;
|
|
51
|
+
height: 270px;
|
|
52
|
+
max-width: 100%;
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
55
|
+
<script src="https://cdn.jsdelivr.net/npm/multi_embed_player@3/dist/multi_embed_player.js"></script>
|
|
56
|
+
<multi-embed-player videoid="_NC_pqMt5rY" service="youtube" follow_GDPR="true"></multi-embed-player>
|
|
57
|
+
|
|
58
|
+
## Notice
|
|
59
|
+
|
|
60
|
+
There is no way to back down accept to access external service from embed content in default.
|
|
61
|
+
|
|
62
|
+
So you may need to set back down accept to access external service button.
|
|
63
|
+
|
|
64
|
+
This is example of this button.
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<button onclick="multi_embed_player_GDPR_accepted_all_back_down()">Back down accept to access external service in embed content</button>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<!--live demo of this code-->
|
|
71
|
+
<button onclick="multi_embed_player_GDPR_accepted_all_back_down()">Back down accept to access external service in embed content</button>
|
|
72
|
+
|
|
73
|
+
This way has one known issue.
|
|
74
|
+
|
|
75
|
+
After use button, you need to reload page to use embed content.
|
|
76
|
+
|
|
77
|
+
If not to do this, embed content will be load content from external service which is not granted to access because of GDPR mode.
|