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

# Video Player Frame Ready

[Video](../index.md) / [Video Player](index.md) / **Video Player Frame Ready**

## Description

Executes whenever the Frame Ready event of Video Player component is invoked

## Parameters

| Name | Description |
| :--- | :---------- |
| Source |  |

## 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
{
    [Title("Video Player Frame Ready")]
    [Category("Video/Video Player/Frame Ready")]
    [Description("Executes whenever the Frame Ready event of Video Player component is invoked")]
    
    [Image(typeof(IconVideo), ColorTheme.Type.Blue)]
    [Keywords("Movie, Film")]
    
    [Parameter("Source")]
    
    [Serializable]
    public class GenTriggerVideoPlayer_FrameReady : TriggerSourceComponentBase<VideoPlayer>
    {
        
        public GenTriggerVideoPlayer_FrameReady() : base(new GenTypeGameObject_VideoPlayer())
        { }
        
        protected override string GetTitle(GameObject source)
        {
            string member = TextUtils.ThemeAsKeyword("Frame Ready");
            return $"{this.SourceName} {member}";
        }
        
        protected override void OnSourceChanged(VideoPlayer previousSource, VideoPlayer newSource)
        {
            if (previousSource != null)
            {
                previousSource.frameReady -= this.Run;
            }
            
            if (newSource != null)
            {
                newSource.frameReady += this.Run;
            }
        }
        
        private void Run(VideoPlayer value1, long value2)
        {
            using Args args = Args.Get(
                this.Component,
                this.m_CurrentSource
            );
            
            this.Run(args);
        }
    }
}


```

