IVideoPlayer¶
Namespace: VideoCataloger
Type: Interface
Interface to control the video player.
Definition¶
Methods¶
| Method | Description |
|---|---|
| SetSelectedVideo(long, string, double, string, byte[], string) | Set the selected video in the video player. Encrypted parameters are only needed for encrypted videos. |
| Seek(double) | Seek to a time in the video |
| GetPlayPosition() | Get the current play position in seconds |
| UnPauseMovie() | Resume playing from pause |
| PauseMovie() | Toggle Pause of video |
| PauseNoToggleMovie() | Pause movie but do not start it if it is already paused |
| PlayMovie() | Play video |
| StopMovie() | Stop the video |
| CloseVideo() | Unload the video so the player no longer holds the file open |
| PlayFromTimeMS(double) | Start playing from the provided time from the start |
| GetVolume() | Get the current volume of the video player. |
| SetVolume(double) | Set the volume of the video player. |
| GetPlaybackRate() | Get the current playback speed. 1.0 is normal playback speed. |
| SetPlaybackRate(float) | Set the speed factor of video playback, 1.0 is normal speed. |
| IsFullscreen() | Is the video in fullscreen mode? |
| IsVideoPlaying() | Return true if the video is playing |
| IsVideoPaused() | Return true if the video is paused |
| IsVideoStopped() | Return true if the video is stopped |
| GetSelectedVideoPath() | Get the path of the video currently selected in the player. |
| GetSelectedVideoID() | Get the video catalog id of the video currently selected in the player. |
SetSelectedVideo¶
Set the selected video in the video player. Encrypted parameters are only needed for encrypted videos.
void SetSelectedVideo(long video_id, string video_path, double video_length, string encrypted, byte[] IV, string key)
Parameters:
| Name | Type | Description |
|---|---|---|
video_id |
Int64 |
ID of the video. |
video_path |
String |
Path to the video. |
video_length |
Double |
Length of the video. |
encrypted |
String |
For encryted videos. |
IV |
Byte[] |
For encryted videos. |
key |
String |
For encryted videos. |
Seek¶
Seek to a time in the video
Parameters:
| Name | Type | Description |
|---|---|---|
seek_to |
Double |
s from start of video. |
GetPlayPosition¶
Get the current play position in seconds
Returns: Double
UnPauseMovie¶
Resume playing from pause
PauseMovie¶
Toggle Pause of video
PauseNoToggleMovie¶
Pause movie but do not start it if it is already paused
PlayMovie¶
Play video
StopMovie¶
Stop the video
Stopping does not unload the video, and a loaded video keeps its file open. Use CloseVideo before moving, renaming or deleting the file.
CloseVideo¶
Unload the video from the player so that it no longer holds the file open. Call it before a script moves, renames or deletes the file of the video in the player; with the video only stopped, that fails with a sharing violation. The selection in the catalog is not changed, and selecting the video again loads it.
The player lets go of the file a moment after the call returns, so retry a file operation that fails with a sharing violation for a second or two.
PlayFromTimeMS¶
Start playing from the provided time from the start
Parameters:
| Name | Type | Description |
|---|---|---|
seek_to |
Double |
s from start of video. |
Returns: Threading.Tasks.Task
GetVolume¶
Get the current volume of the video player.
Returns: Double
- Volume between 0 and 100 where 100 is max volume and 0 is silent.
SetVolume¶
Set the volume of the video player. The volume slider in the player window is updated to match.
Parameters:
| Name | Type | Description |
|---|---|---|
volume |
Double |
Volume between 0 and 100 where 100 is max volume and 0 is silent. Values outside the range are clamped. |
GetPlaybackRate¶
Get the playback speed most recently requested through SetPlaybackRate. 1.0 is normal playback speed.
Returns: Single
- Requested playback rate where 1 is normal speed, 2 is double playback speed.
This returns the requested rate, not a measurement of the renderer. The actual speed is decided by the DirectShow filter graph, which can refuse the rate or negotiate a different one depending on what the container and codec support. To find the speed actually achieved, time playhead travel against wall clock.
IsValidPlaybackRate¶
Check if a value can be passed to SetPlaybackRate without throwing.
Parameters:
| Name | Type | Description |
|---|---|---|
speed_factor |
Single |
Playback rate to validate, where 1.0 is normal speed. |
Returns: Boolean
- True if the value is a valid playback rate: a positive, finite number.
A valid rate can still be refused by the filter graph if the video format does not support playback at that speed, in which case playback continues at the rate it already had.
SetPlaybackRate¶
Set the speed factor of video playback, 1.0 is normal speed.
Parameters:
| Name | Type | Description |
|---|---|---|
speed_factor |
Single |
Speed factor, must be greater than 0. 1.0 is normal speed, 2.0 is double speed, 0.5 is half speed. Reverse playback is not supported. |
Throws: ArgumentOutOfRangeException if speed_factor is zero, negative, NaN or infinity.
Speed is not supported by all video formats. If the graph refuses the rate it keeps playing at the one it already had — playback is unchanged and no error is reported, so a positive rate being accepted by this call is not a guarantee that the video is playing at it.
IsFullscreen¶
Is the video in fullscreen mode?
Returns: Boolean
- True if the video is´in fullscreen mode.
IsVideoPlaying¶
Return true if the video is playing
Returns: Boolean
- True if the video is´playing.
IsVideoPaused¶
Return true if the video is paused
Returns: Boolean
- True if the video is´paused.
IsVideoStopped¶
Return true if the video is stopped
Returns: Boolean
- True if the video is´stopped.
GetSelectedVideoPath¶
Get the path of the video currently selected in the player.
Returns: String
- Full path to the video selected in the video player.
GetSelectedVideoID¶
Get the video catalog id of the video currently selected in the player.
Returns: Int64
- ID of the video selected in the video player.
GetSelectedVideoID¶
Get the video catalog id of the video currently selected in the player.
Returns: Int64
- ID of the video selected in the video player.