diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index 8fdedb3..197425f 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -628,29 +628,23 @@ namespace QuickMedia { Page previous_page = pop_page_stack(); + bool ui_resize = true; + bool seekable = false; + + std::unique_ptr<VideoPlayer> video_player; + std::unique_ptr<sf::RenderWindow> video_player_ui_window; - auto on_window_create = [this, &video_player_ui_window](sf::WindowHandle video_player_window) { + auto on_window_create = [this, &video_player_ui_window, &video_player, &seekable](sf::WindowHandle video_player_window) { int screen = DefaultScreen(disp); - Window ui_window = XCreateWindow(disp, RootWindow(disp, screen), - 0, 0, 1, 1, 0, - DefaultDepth(disp, screen), - InputOutput, - DefaultVisual(disp, screen), - 0, NULL); - - XReparentWindow(disp, ui_window, video_player_window, 0, 0); + Window ui_window = XCreateSimpleWindow(disp, video_player_window, 0, 0, 1, 1, 0, 0, BlackPixel(disp, screen)); XMapWindow(disp, ui_window); XFlush(disp); video_player_ui_window = std::make_unique<sf::RenderWindow>(ui_window); video_player_ui_window->setVerticalSyncEnabled(true); + video_player->is_seekable(&seekable); }; - bool ui_resize = true; - bool seekable = false; - - std::unique_ptr<VideoPlayer> video_player; - auto load_video_error_check = [this, &video_player, previous_page]() { watched_videos.insert(content_url); VideoPlayer::Error err = video_player->load_video(content_url.c_str(), window.getSystemHandle()); |