Skip to content

Youtube Player

Category Requires Version
Google API 21, Android 5.0 Lollipop 3

Overview

A visible component that plays YouTube videos.
Note: For this component to work correctly, set the MIN API to 17 (Android 4.2).

Permissions

Events

Current Second Changed

Called periodically by the player, the argument is the number of seconds that have been played.

Params
second Number

Error

Use this event to detect that there was any error with the player. Return values: 'UNKNOWN', 'INVALID_PARAMETER_IN_REQUEST', 'HTML_5_PLAYER', 'VIDEO_NOT_FOUND', 'VIDEO_NOT_PLAYABLE_IN_EMBEDDED_PLAYER', 'REQUEST_MISSING_HTTP_REFERER'.

Params
error Text

Fullscreen

Event to get notified when the player enters or exits fullscreen. The variable 'fullscreen' returns true or false.

Params
fullscreen Boolean

Initialized

Use this event to start the playing of a normal or instant youtube video.

Loaded Fraction Changed

Called periodically by the player, the argument is the percentage of the video that has been buffered.

Params
loaded Fraction Number

Playback Quality Changed

Use this event to detect that the playback quality was changed. Return values: 'UNKNOWN', 'SMALL', 'MEDIUM', 'LARGE', 'HD720', 'HD1080', 'HIGH_RES' or 'DEFAULT'.

Params
quality Text

Playback Rate Changed

Use this event to detect that the playback rate was changed. Return values: 'UNKNOWN', 'RATE_0_25', 'RATE_0_5', 'RATE_0_75', 'RATE_1', 'RATE_1_25', 'RATE_1_5', 'RATE_1_75 or 'RATE_2'.

Params
rate Text

State Changed

Use this event to detect that the state changes. Return values: 'UNKNOWN', 'UNSTARTED', 'ENDED', 'PLAYING', 'PAUSED', 'BUFFERING' or 'VIDEO_CUED'.

Params
state Text

Methods

Enter Fullscreen

⚠ Deprecated

DEPRECATED. Does nothing.

Exit Fullscreen

⚠ Deprecated

DEPRECATED. Does nothing.

Get Thumbnail From Video Id

Returns: Text

This block will return the thumbnail image path from a video id. Use only as example '_bZj-LOXdH8' from a youtube video.

Params
video Id Text

Instant Load

Use this block together with the 'Youtube Player' Initialized event. Loads and automatically plays the specified youtube video. Use only as example '_bZj-LOXdH8' from a youtube video.

Params
video Id Text

Load

Loads the specified video's thumbnail and prepares the player to play the video. Does not automatically play the video. Use only as example '_bZj-LOXdH8' from a youtube video.

Params
video Id Text

Pause

Pause the youtube video.

Play

Plays the youtube video.

Seek To

Set a position where the youtube video should start playing in seconds.

Params
position Number

Toggle Fullscreen

⚠ Deprecated

DEPRECATED. Does nothing.

Properties

Custom Video Title

Text ➖ Write - Blocks

Use this to change the video title.

Enable Live Video UI

Boolean Default: False ➖ Read Write - Designer Blocks

If you want to play live videos you must setup the UI accordingly by calling this method. If enabled, the user cannot select a second on the video progress bar.

Get Current Second

Number ➖ Read - Blocks

Returns the current second.

Get Video Duration

Number ➖ Read - Blocks

Returns the video duration in seconds.

Height

Number ➖ Read Write - Blocks

Specifies the component's vertical height, measured in pixels.

Height Percent

Number ➖ Write - Blocks

Specifies the component's vertical height as a percentageof the height of its parent Component.

Is Fullscreen

⚠ Deprecated

Boolean ➖ Read - Blocks

DEPRECATED. Does nothing.

Show Buffering Progress

Boolean ➖ Read Write - Blocks

Use this to show or hide the buffering progress.

Show Current Time

Boolean ➖ Read Write - Blocks

Use this to show or hide the current time.

Show Duration

Boolean ➖ Read Write - Blocks

Use this to show or hide the duration.

Show Fullscreen Button

Boolean ➖ Read Write - Blocks

Use this to show or hide the fullscreen button.

Show Play Pause Button

Boolean ➖ Read Write - Blocks

Use this to show or hide the play/pause button.

Show SeekBar

Boolean ➖ Read Write - Blocks

Use this to show or hide the seekbar.

Show UI

Boolean ➖ Read Write - Blocks

Use this to show or hide the player's UI.

Show Video Title

Boolean ➖ Read Write - Blocks

Use this to show or hide the video title.

Show YouTube Button

Boolean ➖ Read Write - Blocks

Use this to show or hide the YouTube button.

Start Second

Number Default: 0 ➖ Read Write - Designer Blocks

The time from which the video should start playing.

Test Video Id

Text ➖ Read - Blocks

Use this block to test the youtube player.

Visible

Boolean Default: True ➖ Read Write - Designer Blocks

Returns true iff the component is visible.

Volume

Number Default: 50 ➖ Read Write - Designer Blocks

Set the volume to a number between 0 and 100. Use only integer numbers.

Width

Number ➖ Read Write - Blocks

Specifies the component's horizontal width, measured in pixels.

Width Percent

Number ➖ Write - Blocks

Specifies the component's horizontal width as a percentageof the Width of its parent Component.