YoutubePlayerWorldComponent

Provides YouTube video play function in the World.

# Properties

[{"index":"Vector2 ControllerScale","0":"Sets the size of the video control UI. The value must be bigger than 0."}]

[{"index":"boolean IgnoreMapLayerCheck","0":"Doesn't perform automatic replace when designating the Map Layer name into SortingLayer."}]

[{"index":"Vector2 LocalScale","0":"Sets the video size. The value must be bigger than 0."}]

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

[{"index":"boolean ShowController","0":"Sets whether to display the video control UI."}]

[{"index":"string SortingLayer","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 YoutubePlayerController extends Component
        property any youtubePlayer = nil
    
        @ExecSpace("ClientOnly")
        method void OnBeginPlay()
        self.youtubePlayer = self.Entity.YoutubePlayerWorldComponent
        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

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