本文整理汇总了C++中VideoPtr::EnableMediaPlaying方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoPtr::EnableMediaPlaying方法的具体用法?C++ VideoPtr::EnableMediaPlaying怎么用?C++ VideoPtr::EnableMediaPlaying使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoPtr
的用法示例。
在下文中一共展示了VideoPtr::EnableMediaPlaying方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PlayCutscene
GS_PLAYER_INFO PlayCutscene(VideoPtr pVideo, const std::wstring& fileName,
InputPtr pInput, const GS_KEY escapeKey)
{
if (!pVideo)
{
ShowMessage(L"Invalid video handler - gs2d::PlayCutscene", GSMT_ERROR);
return GSPI_FAILED;
}
GS_PLAYER_INFO info = GSPI_FINISHED;
//pVideo->TurnLoopManagerOff();
const bool rendering = pVideo->Rendering();
if (rendering)
pVideo->EndSpriteScene();
PlayerPtr player = CreatePlayer(pVideo, fileName);
if (!player)
{
ShowMessage(L"Failed while trying to load the video - gs2d::PlayCutscene", GSMT_ERROR);
if (rendering)
pVideo->BeginSpriteScene();
return GSPI_FAILED;
}
pVideo->EnableMediaPlaying(true);
player->SetFullscreen();
player->Rewind();
player->Play();
while (!player->IsFinished())
{
player->UpdateVideo();
const Video::APP_STATUS status = pVideo->HandleEvents();
if (status == Video::APP_QUIT)
{
info = GSPI_CLOSE_WINDOW;
break;
}
else
{
if (status == Video::APP_SKIP)
continue;
}
if (pInput)
{
pInput->Update();
if (pInput->GetKeyState(escapeKey) == GSKS_HIT)
{
info = GSPI_SKIPPED;
break;
}
}
}
if (rendering)
pVideo->BeginSpriteScene();
pVideo->EnableMediaPlaying(false);
return info;
}