Skip to main content

Video Feed Screen

The LMFeedVideoFeedFragment is a component responsible for managing and displaying video feeds in the LikeMinds feed. It handles the user interface and interactions associated with video content.

View on GitHub


View Style: LMFeedVideoFeedFragmentViewStyle

The LMFeedVideoFeedFragmentViewStyle defines the styling and layout options for the video feed fragment.

View on GitHub


Customization

General Customizations

  • customizeVideoFeedListView(vp2VideoFeed, videoFeedAdapter): Customize the video feed list view with a ViewPager2 and a video feed adapter LMFeedVideoFeedAdapter.

Configuration

The LMFeedVideoFeedConfig defines few configs options for the video feed fragment.

ConfigTypeDescriptionDefault Value
reelViewedAnalyticThresholdIntthreshold for sending reel viewed event in secs2

View on GitHub


Props

The LMFeedVideoFeedProps defines few extra properties which can be shared to the video feed fragment to complete certain requirements

PropsTypeDescriptionDefault Value
startFeedWithPostIdsList<String>specific post ids to start the feed fromnull

Interactions

Post Interactions

  • onPostLikeClicked(position, postViewData): Triggered when a post is liked, with position and postViewData as inputs.
  • onPostContentSeeMoreClicked(position, postViewData): Triggered when "see more" is clicked for post content.
  • onPostContentLinkClicked(url): Triggered when a URL link in post content is clicked.
  • onPostVideoFeedCaughtUpClicked(): Triggered when the user catches up on video feed posts.

Post Actions

  • onPostActionMenuClicked(position, postViewData): Triggered when the action menu for a post is clicked.
  • onPostMenuItemClicked(postId, menuItem): Triggered when a menu item for a post is clicked.

Author and Tag Interactions

  • onPostAuthorHeaderClicked(position, postViewData): Triggered when the author's header is clicked.
  • onPostTaggedMemberClicked(position, uuid): Triggered when a tagged member in a post is clicked.

Post Menu Interactions

  • onEditPostMenuClicked(position, menuId, post): Triggered when the "edit post" menu item is clicked.
  • onDeletePostMenuClicked(position, menuId, post): Triggered when the "delete post" menu item is clicked.
  • onReportPostMenuClicked(position, menuId, post): Triggered when the "report post" menu item is clicked.

Usage Example

In this example, we're customizing the following elements of the Video Feed screen:

  • Video Feed ListView: Customize the List View as required.
  • Click Listeners: Override behavior for share post click.

Steps to customize

Step 1: Create CustomVideoFeedFragment

Start by extending LMFeedVideoFeedFragment and create a custom class, say CustomVideoFeedFragment.

class CustomVideoFeedFragment : LMFeedVideoFeedFragment() {
// We will override methods in the next step
}

Step 2: Override and Customize Methods

You can customize various aspects of the Video feed screen by overriding specific functions.

note

If you're providing your own custom layout or binding, you must override all lifecycle functions, especially:

  • onCreateView
  • onViewCreated
  • onResume
  • onPause
  • onDestroyView
class CustomVideoFeedFragment : LMFeedVideoFeedFragment() {

override fun customizeVideoFeedListView(vp2VideoFeed: ViewPager2, videoFeedAdapter: LMFeedVideoFeedAdapter) {
super.customizeVideoFeedListView(vp2VideoFeed, videoFeedAdapter)

// Write your logic
}

override fun onPostShareClicked(position: Int, postViewData: LMFeedPostViewData) {
super.onPostShareClicked(position, postViewData)

// Write your logic
}
}

Step 3: Use CustomVideoFeedFragment

You can now use the custom fragment to start Custom Feed Fragment as explained in Getting Started.