File tree Expand file tree Collapse file tree 6 files changed +50
-10
lines changed Expand file tree Collapse file tree 6 files changed +50
-10
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,18 @@ const App = () => {
241
241
} ,
242
242
spotify : {
243
243
preferVideo : true
244
+ } ,
245
+ tiktok : {
246
+ fullscreen_button : true ,
247
+ progress_bar : true ,
248
+ play_button : true ,
249
+ volume_control : true ,
250
+ timestamp : false ,
251
+ music_info : false ,
252
+ description : false ,
253
+ rel : false ,
254
+ native_context_menu : true ,
255
+ closed_caption : false ,
244
256
}
245
257
} }
246
258
onLoadStart = { ( ) => console . log ( 'onLoadStart' ) }
@@ -483,6 +495,13 @@ const App = () => {
483
495
{ renderLoadButton ( 'https://www.twitch.tv/kronovi' , 'Test B' ) }
484
496
</ td >
485
497
</ tr >
498
+ < tr >
499
+ < th > TikTok</ th >
500
+ < td >
501
+ { renderLoadButton ( 'https://www.tiktok.com/@_luwes/video/7527476667770522893' , 'Test A' ) }
502
+ { renderLoadButton ( 'https://www.tiktok.com/@scout2015/video/6718335390845095173' , 'Test B' ) }
503
+ </ td >
504
+ </ tr >
486
505
< tr >
487
506
< th > Custom</ th >
488
507
< td >
Original file line number Diff line number Diff line change 56
56
"deepmerge" : " ^4.0.0" ,
57
57
"hls-video-element" : " ^1.5.6" ,
58
58
"spotify-audio-element" : " ^1.0.2" ,
59
- "twitch-video-element" : " ^0.1.1" ,
60
- "vimeo-video-element" : " ^1.5.2" ,
59
+ "tiktok-video-element" : " ^0.1.0" ,
60
+ "twitch-video-element" : " ^0.1.2" ,
61
+ "vimeo-video-element" : " ^1.5.3" ,
61
62
"wistia-video-element" : " ^1.3.3" ,
62
63
"youtube-video-element" : " ^1.6.1"
63
64
},
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const MATCH_URL_WISTIA =
12
12
/ (?: w i s t i a \. (?: c o m | n e t ) | w i \. s t ) \/ (?: m e d i a s | e m b e d ) \/ (?: i f r a m e \/ ) ? ( [ ^ ? ] + ) / ;
13
13
export const MATCH_URL_SPOTIFY = / o p e n \. s p o t i f y \. c o m \/ ( \w + ) \/ ( \w + ) / i;
14
14
export const MATCH_URL_TWITCH = / (?: w w w \. | g o \. ) ? t w i t c h \. t v \/ ( [ a - z A - Z 0 - 9 _ ] + | ( v i d e o s ? \/ | \? v i d e o = ) \d + ) ( $ | \? ) / ;
15
+ export const MATCH_URL_TIKTOK = / t i k t o k \. c o m \/ (?: @ [ ^ / ] + \/ v i d e o \/ ) ? ( \d + ) (?: \/ ( [ \w - ] + ) ) ? / ;
15
16
16
17
const canPlayFile = ( url : string , test : ( u : string ) => boolean ) => {
17
18
if ( Array . isArray ( url ) ) {
@@ -40,4 +41,5 @@ export const canPlay = {
40
41
wistia : ( url : string ) => MATCH_URL_WISTIA . test ( url ) ,
41
42
spotify : ( url : string ) => MATCH_URL_SPOTIFY . test ( url ) ,
42
43
twitch : ( url : string ) => MATCH_URL_TWITCH . test ( url ) ,
44
+ tiktok : ( url : string ) => MATCH_URL_TIKTOK . test ( url ) ,
43
45
} ;
Original file line number Diff line number Diff line change @@ -84,6 +84,15 @@ const Players: PlayerEntry[] = [
84
84
( ) => import ( /* webpackChunkName: 'reactPlayerTwitch' */ 'twitch-video-element/react' )
85
85
) as React . LazyExoticComponent < React . ComponentType < VideoElementProps > > ,
86
86
} ,
87
+ {
88
+ key : 'tiktok' ,
89
+ name : 'TikTok' ,
90
+ canPlay : canPlay . tiktok ,
91
+ canEnablePIP : ( ) => false ,
92
+ player : lazy (
93
+ ( ) => import ( /* webpackChunkName: 'reactPlayerTiktok' */ 'tiktok-video-element/react' )
94
+ ) as React . LazyExoticComponent < React . ComponentType < VideoElementProps > > ,
95
+ } ,
87
96
{
88
97
key : 'html' ,
89
98
name : 'html' ,
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import type SpotifyAudioElement from 'spotify-audio-element';
4
4
import type YouTubeVideoElement from 'youtube-video-element' ;
5
5
import type VimeoVideoElement from 'vimeo-video-element' ;
6
6
import type TwitchVideoElement from 'twitch-video-element' ;
7
+ import type TikTokVideoElement from 'tiktok-video-element' ;
7
8
8
9
interface VideoHTMLAttributes < T > extends MediaHTMLAttributes < T > {
9
10
height ?: number | string | undefined ;
@@ -49,6 +50,7 @@ export interface Config {
49
50
html ?: Record < string , unknown > ;
50
51
mux ?: Record < string , unknown > ;
51
52
spotify ?: SpotifyAudioElement [ 'config' ] ;
53
+ tiktok ?: TikTokVideoElement [ 'config' ] ;
52
54
twitch ?: TwitchVideoElement [ 'config' ] ;
53
55
vimeo ?: VimeoVideoElement [ 'config' ] ;
54
56
wistia ?: Record < string , unknown > ;
You can’t perform that action at this time.
0 commit comments