pub struct VideoPlayerState {
pub videos: HashMap<String, String>,
/* private fields */
}
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
Auto Trait Implementations§
impl !Freeze for VideoPlayerState
impl RefUnwindSafe for VideoPlayerState
impl Send for VideoPlayerState
impl Sync for VideoPlayerState
impl Unpin for VideoPlayerState
impl UnwindSafe for VideoPlayerState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more