Widget Documentation: 'LMFeedVideoView'
Widget: 'LMFeedVideoView'
The LMFeedVideoView
is a custom widget designed for handling video playback in the LikeMinds feed. It supports playing videos from both local and remote sources and includes functionalities like caching, thumbnail management, and customizable styles.
Method | Description |
---|---|
fun init() | Initializes the video player for use. |
fun onPlaybackStateChanged(playbackState: Int) | Handles changes in the video playback state. |
fun startPlayingRemoteUri(videoUri: Uri, progressBar: LMFeedProgressBar, thumbnailView: LMFeedImageView, thumbnailSrc: Any? = null) | Starts playing a video from a remote URI. Displays a progress bar and manages a thumbnail. |
fun createCachedMediaSource(context: Context, uri: Uri) | Creates a cached media source for efficient playback of videos. |
fun inferContentType(uri: Uri) | Infers the content type of the video based on its URI. |
fun startPlayingLocalUri(videoUri: Uri, progressBar: LMFeedProgressBar, thumbnailView: LMFeedImageView, thumbnailSrc: Any? = null) | Starts playing a video from a local URI. Displays a progress bar and manages a thumbnail. |
fun removePlayer() | Removes and releases the video player resources. |
fun setStyle(postVideoMediaStyle: LMFeedPostVideoMediaViewStyle) | Applies a specific style configuration to the video view. |
fun setThumbnail(thumbnailView: LMFeedImageView, thumbnailSrc: Any?) | Sets a thumbnail for the video view. |
View LMFeedVideoView on GitHub
View Style: 'LMFeedPostVideoMediaViewStyle'
The LMFeedPostVideoMediaViewStyle
defines the visual configuration for the video view widget, including styles for its thumbnail, progress bar, play/pause button, and other customizable elements.
Field | Description | Type |
---|---|---|
videoThumbnailStyle | The style for the video thumbnail. | LMFeedImageStyle? |
videoProgressStyle | The style for the progress bar displayed on the video. | LMFeedProgressBarStyle? |
videoPlayPauseButton | The style for the play/pause button on the video. | LMFeedIconStyle |
videoMuteUnmuteButton | The style for the mute/unmute button on the video. | LMFeedIconStyle? |
showController | Indicates whether the video controller is shown. | Boolean |
keepScreenOn | Keeps the screen on while the video is playing. | Boolean |
controllerAutoShow | Automatically shows the controller when video starts. | Boolean |
controllerShowTimeoutMs | Timeout for hiding the video controller. | Int |
backgroundColor | The background color for the video view. | Int? |
removeIconStyle | Style for the remove icon on the video view. | LMFeedIconStyle |