video_get_status

此函数返回当前加载的视频的状态。状态可以是以下任意一个常量:

视频状态常量
常量描述
video_status_closedNo video is currently loaded, or the video was closed with video_close()
video_status_preparingThe video is currently preparing and has not started playing yet
video_status_playingThe video is currently playing
video_status_pausedThe video is paused (see video_pause())

 

语法:

video_get_status();

 

返回:

Video Status Constant

 

例子:

var _status = video_get_status();

if (keyboard_check_pressed(vk_space))
{
    if (_status == video_status_playing)
    {
        video_pause();
    }
    else if (status == video_status_paused)
    {
        video_resume();
    }
}

上述代码获取视频的状态,然后检查播放器是否已按空格键。在这种情况下,如果视频正在播放,它会暂停视频,如果暂停,它会恢复视频。