Struct static_video_server::VideoPlayerState
source · Expand description
The video index state that is shared between all requests. Store a list of videos and their paths.
Fields§
§videos: HashMap<String, String>Implementations§
source§impl VideoPlayerState
impl VideoPlayerState
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new video index state. This will configure the video extensions that are interpreted as videos.
sourcepub fn is_video_file<P: AsRef<Path>>(&self, path: P) -> bool
pub fn is_video_file<P: AsRef<Path>>(&self, path: P) -> bool
Check if a path is a supported video file.
pub fn load_videos<P: AsRef<Path>>(&mut self, root: P) -> Result<()>
sourcepub fn load_video(&mut self, path: PathBuf)
pub fn load_video(&mut self, path: PathBuf)
Load a video from a path.
sourcepub fn visit_dirs<P: AsRef<Path>>(&mut self, root: P) -> Result<()>
pub fn visit_dirs<P: AsRef<Path>>(&mut self, root: P) -> Result<()>
Recursively visit all directories and load videos from them.
sourcepub fn build(config: &VideoPlayerConfig) -> Self
pub fn build(config: &VideoPlayerConfig) -> Self
Build a new video index state from a config.
Trait Implementations§
source§impl Default for VideoPlayerState
impl Default for VideoPlayerState
source§fn default() -> VideoPlayerState
fn default() -> VideoPlayerState
Returns the “default value” for a type. Read more