Skip to main content

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.

MethodDescription
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.

FieldDescriptionType
videoThumbnailStyleThe style for the video thumbnail.LMFeedImageStyle?
videoProgressStyleThe style for the progress bar displayed on the video.LMFeedProgressBarStyle?
videoPlayPauseButtonThe style for the play/pause button on the video.LMFeedIconStyle
videoMuteUnmuteButtonThe style for the mute/unmute button on the video.LMFeedIconStyle?
showControllerIndicates whether the video controller is shown.Boolean
keepScreenOnKeeps the screen on while the video is playing.Boolean
controllerAutoShowAutomatically shows the controller when video starts.Boolean
controllerShowTimeoutMsTimeout for hiding the video controller.Int
backgroundColorThe background color for the video view.Int?
removeIconStyleStyle for the remove icon on the video view.LMFeedIconStyle

View LMFeedPostVideoMediaViewStyle on GitHub