public override void ProcessFrame(Playable playable, FrameData info, object playerData)
        {
            if (m_Clips == null)
            {
                return;
            }

            int inputPort = 0;

            foreach (TimelineClip clip in m_Clips)
            {
                ScriptPlayable <VideoPlayableBehaviour> scriptPlayable =
                    (ScriptPlayable <VideoPlayableBehaviour>)playable.GetInput(inputPort);

                VideoPlayableBehaviour videoPlayableBehaviour = scriptPlayable.GetBehaviour();

                if (videoPlayableBehaviour != null)
                {
                    double preloadTime = Math.Max(0.0, videoPlayableBehaviour.preloadTime);
                    if (m_Director.time >= clip.start + clip.duration ||
                        m_Director.time <= clip.start - preloadTime)
                    {
                        videoPlayableBehaviour.StopVideo();
                    }
                    else if (m_Director.time > clip.start - preloadTime)
                    {
                        videoPlayableBehaviour.PrepareVideo();
                    }
                }

                ++inputPort;
            }
        }
        public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
        {
            ScriptPlayable <VideoPlayableBehaviour> playable =
                ScriptPlayable <VideoPlayableBehaviour> .Create(graph);

            VideoPlayableBehaviour playableBehaviour = playable.GetBehaviour();

            playableBehaviour.videoPlayer = videoPlayer.Resolve(graph.GetResolver());
            playableBehaviour.videoClip   = videoClip;
            playableBehaviour.mute        = mute;
            playableBehaviour.loop        = loop;
            playableBehaviour.preloadTime = preloadTime;
            playableBehaviour.clipInTime  = clipInTime;

            return(playable);
        }
示例#3
0
        public override Playable CreatePlayable(PlayableGraph graph, GameObject go)
        {
            ScriptPlayable <VideoPlayableBehaviour> playable =
                ScriptPlayable <VideoPlayableBehaviour> .Create(graph);

            VideoPlayableBehaviour playableBehaviour = playable.GetBehaviour();

            playableBehaviour.videoClip       = videoClip;
            playableBehaviour.mute            = mute;
            playableBehaviour.loop            = loop;
            playableBehaviour.preloadTime     = preloadTime;
            playableBehaviour.startTime       = startTime;
            playableBehaviour.endTime         = endTime;
            playableBehaviour.image           = image.Resolve(graph.GetResolver());
            playableBehaviour.audioOutputMode = audioOutputMode;
            playableBehaviour.audioSource     = audioSource.Resolve(graph.GetResolver());

            return(playable);
        }