---
tags:
    - "Movie, Film"
---

# Video Player Url

[Video](../index.md) / [Video Player](index.md) / **Video Player Url**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :green_circle: Can Write

</div>

## Description

The Url property of the Video Player component

## Code

```cs
// <auto-generated>
// This script was automatically generated using the Visual Script Transpiler.
// Do not modify. Changes to this file will be lost when updating the package.
// </auto-generated>

using System;
using UnityEngine;
using VisualScript.Icons;
using UnityEngine.Video;

namespace VisualScript.Runtime
{
    [Get]
    [Set]
    
    [Title("Video Player Url")]
    [Category("Video/Video Player/Url")]
    [Description("The Url property of the Video Player component")]
    
    [Image(typeof(IconVideo), ColorTheme.Type.Blue)]
    [Keywords("Movie, Film")]
    
    [Serializable]
    public class GenTypeString_VideoPlayer_Url : TypeString
    {
        [SerializeField] private GetGameObject m_VideoPlayer = new GetGameObject(
            new GenTypeGameObject_VideoPlayer()
        );
        
        public override string GetPreview(GameObject source)
        {
            GameObject instance = this.m_VideoPlayer.GetPreview(source);
            if (instance == null) return default;
            
            VideoPlayer component = instance.GetComponent<VideoPlayer>();
            return component != null ? component.url : default;
        }
        
        public override string Get(Args args)
        {
            VideoPlayer instance = this.m_VideoPlayer.Get<VideoPlayer>(args);
            return instance != null
                ? instance.url
                : default;
        }
        
        public override void Set(string value, Args args)
        {
            VideoPlayer component = this.m_VideoPlayer.Get<VideoPlayer>(args);
            if (component != null) component.url = (string) value;
        }
        
        public override string ToString()
        {
            return $"{this.m_VideoPlayer} Url";
        }
        
        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}


```

