From 85c6c916541968f298badb391b718cdf6d81d332 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 19 Jun 2021 13:13:59 +0200 Subject: Support youtube description chapters --- include/MediaChapter.hpp | 10 ++++++++++ include/VideoPlayer.hpp | 7 +++---- 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 include/MediaChapter.hpp (limited to 'include') diff --git a/include/MediaChapter.hpp b/include/MediaChapter.hpp new file mode 100644 index 0000000..f90493b --- /dev/null +++ b/include/MediaChapter.hpp @@ -0,0 +1,10 @@ +#pragma once + +#include + +namespace QuickMedia { + struct MediaChapter { + int start_seconds = 0; + std::string title; // newlines will be replaced by spaces + }; +} \ No newline at end of file diff --git a/include/VideoPlayer.hpp b/include/VideoPlayer.hpp index a7906a2..1a1e418 100644 --- a/include/VideoPlayer.hpp +++ b/include/VideoPlayer.hpp @@ -1,12 +1,10 @@ #pragma once +#include "MediaChapter.hpp" #include #include -#include #include #include - -#include #include namespace QuickMedia { @@ -41,7 +39,7 @@ namespace QuickMedia { VideoPlayer& operator=(const VideoPlayer&) = delete; // |audio_path| is only set when video and audio are separate files/urls. - Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = ""); + Error load_video(const char *path, const char *audio_path, sf::WindowHandle parent_window, bool is_youtube, const std::string &title, const std::string &start_time = "", const std::vector &chapters = {}); // Should be called every update frame Error update(); @@ -83,5 +81,6 @@ namespace QuickMedia { }; ResponseDataStatus response_data_status; std::string resource_root; + char tmp_chapters_filepath[27]; }; } -- cgit v1.2.3