此函数返回当前加载的视频的状态。状态可以是以下任意一个常量:
视频状态常量 | |
---|---|
常量 | 描述 |
video_status_closed | No video is currently loaded, or the video was closed with video_close() |
video_status_preparing | The video is currently preparing and has not started playing yet |
video_status_playing | The video is currently playing |
video_status_paused | The 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();
}
}
上述代码获取视频的状态,然后检查播放器是否已按空格键。在这种情况下,如果视频正在播放,它会暂停视频,如果暂停,它会恢复视频。