YoutubePlayerGUIComponent

Provides YouTube video play function on the UI.

# Properties

[{"index":"boolean IgnoreMapLayerCheck (Sync)","0":"Does not perform automatic substitution when the Map Layer's name is specified in SortingLayer."}]

[{"index":"int32 OrderInLayer (Sync)","0":"Determines the priority within the same layer. A higher number indicates higher priority."}]

[{"index":"boolean OverrideSorting (Sync) (ReadOnly)","0":"Determines whether to set the SortingLayer and OrderInLayer values manually."}]

[{"index":"string SortingLayer (Sync)","0":"When two or more entities overlap, the priority is determined according to the Sorting Layer."}]

##### inherited from YoutubePlayerCommonComponent:

[{"index":"boolean Loop","0":"Sets whether to repeat playback of the video."}]

[{"index":"boolean PlayOnAwake","0":"Sets whether to play the video on starting the world."}]

[{"index":"float PlaySpeed (Sync)","0":"Sets up the play speed of videos. You can use values between 0.5 and 3."}]

[{"index":"boolean Shuffle","0":"Sets whether to shuffle playback order of the videos saved in Urls when a value is true."}]

[{"index":"List Urls","0":"Specifies video URLs."}]

[{"index":"float Volume (Sync)","0":"Sets the volume level. You can use values between 0 and 1."}]

##### inherited from Component:

[{"index":"boolean Enable (Sync)","0":"Checks whether Component is activated or not."}]

[{"index":"boolean EnableInHierarchy (ReadOnly) (HideFromInspector)","0":"Displays whether this Component is Enable in the hierarchy. If Entity Enable is false regardless of Component Enable, returns false."}]

[{"index":"Entity Entity (ReadOnly)","0":"The Entity that owns this component."}]

# Methods

##### inherited from YoutubePlayerCommonComponent:

[{"index":"void ClearScreen(string targetUserId = nil) (Client)","0":"Stops video playback and clears the screen."}]

[{"index":"void Jump(int32 timeInSeconds, string targetUserId = nil) (Client)","0":"Move the play point to a specific time and then play. The unit of time is the second in an integer."}]

[{"index":"void Pause(string targetUserId = nil) (Client)","0":"Pauses video playback."}]

[{"index":"void Play(string targetUserId = nil) (Client)","0":"Replays all videos from the beginning."}]

[{"index":"void PlayPause(string targetUserId = nil) (Client)","0":"Stops or plays paused video."}]

##### inherited from Component:

[{"index":"boolean IsClient()","0":"Returns whether the current execution environment is a client or not."}]

[{"index":"boolean IsServer()","0":"Returns whether the current execution environment is a server or not."}]

# Events

[{"index":"OrderInLayerChangedEvent","0":"This event occurs when changing the Component's OrderInLayer."}]

[{"index":"SortingLayerChangedEvent","0":"This event occurs when changing the component's SortingLayer."}]

# Examples

This is an example of entering the URL of a YouTube video you want to play, controlling the playback, and pausing the video by pressing a specific key.
    
    
    @Component
    script YoutubePlaybackController extends Component
        property any youtubePlayer = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.youtubePlayer = self.Entity.YoutubePlayerGUIComponent
        self.youtubePlayer.Urls = {"Http://WebUrl"}
        end
    
        @EventSender("Service", "inputService")
        handler HandleKeyDownEvent(KeyDownEvent event)
        --------------- Native Event Sender Info ----------------
        -- Sender: InputService
        -- Space: Client
        ---------------------------------------------------------
    
        -- Parameters
        local key = event.key
        ---------------------------------------------------------
    
        if key == KeyboardKey.Alpha1 then
        	self.youtubePlayer:Play()
        elseif key == KeyboardKey.Alpha2 then
        	self.youtubePlayer:Pause()
        elseif key == KeyboardKey.Alpha3 then
        	self.youtubePlayer:Jump(20)
        elseif key == KeyboardKey.Alpha4 then
        	self.youtubePlayer:PlayPause()
        end
        end
    end
    

# SeeAlso

  * KeyboardKey
  * [Playing Videos](/docs?postId=539)