| 76 | } |
| 77 | |
| 78 | void VideoPlayer::Play() |
| 79 | { |
| 80 | auto state = _state; |
| 81 | if (state == States::Playing) |
| 82 | return; |
| 83 | |
| 84 | if (!_player.Backend) |
| 85 | { |
| 86 | if (Url.IsEmpty()) |
| 87 | { |
| 88 | LOG(Warning, "Cannot play Video source without an url ({0})", GetNamePath()); |
| 89 | return; |
| 90 | } |
| 91 | |
| 92 | // Create video player |
| 93 | VideoBackendPlayerInfo info; |
| 94 | GetInfo(info); |
| 95 | if (Video::CreatePlayerBackend(info, _player)) |
| 96 | return; |
| 97 | |
| 98 | // Pre-allocate output video texture |
| 99 | _player.InitVideoFrame(); |
| 100 | } |
| 101 | |
| 102 | _player.Backend->Player_Play(_player); |
| 103 | _state = States::Playing; |
| 104 | } |
| 105 | |
| 106 | void VideoPlayer::Pause() |
| 107 | { |
nothing calls this directly
no test coverage detected