YouTube/Twitch#

嵌入 YouTube 视频/直播 或 Twitch 直播。

youtube-example.png

Editor 编辑器#

youtube_editor

Screen ratio 屏幕比例#

视频的屏幕比例:16:94:3

URL#

要播放的视频的 YouTube/Twitch URL。

https://www.youtube.com/watch?v=Q5-0hl_4X_g

https://www.twitch.tv/muse_tw

Thumbnail url 缩略图URL#

(可选) 让用户为视频设置自定义缩略图。

脚本属性#

String; Links must be https:// and must either be a youtube, twitch, soundcloud, spotify.

get()

feature.get('url')
// returns: "https://..."

set()

feature.set({'url':"https://www.youtube.com/?v=..."})

default

""

String; Links must be https:// and must either be a .png,.gif,jpg.

get()

feature.get('previewUrl')
// returns: "https://..."

set()

feature.set({'previewUrl':"https://..."})

default

""

String; Links must be https:// and must either be a .png,.gif,jpg.

get()

feature.get('screenRatio')
// returns: "43"

set()

feature.set({'screenRatio':"169"})

default

"169"

String;

get()

feature.get('type')
/* or */
feature.type

// returns: 'youtube'

脚本方法#

feature.play()

plays the video

feature.pause()

pauses the video