Single Content Feed

Single Content Feed displays a single specific video or livestream. Users will see only that particular piece of content, making it ideal for featuring specific videos or handling direct video links.

Overview

This feed type focuses on displaying exactly one video or livestream. It's perfect for scenarios where you want to showcase a specific piece of content without showing related or additional videos.

Usage

Required Parameter

  • contentId - Your encoded video identifier (required, non-empty)

XML Configuration

<com.firework.videofeed.FwVideoFeedView
    android:id="@+id/videoFeedView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

Programmatic Configuration

val viewOptions = viewOptions {
    baseOptions {
        feedResource(
            FeedResource.SingleContent(contentId = "encoded_video_id")
        )
    }
    layoutOptions {
        feedLayout(FeedLayout.HORIZONTAL)
    }
}

val videoFeedView = findViewById<FwVideoFeedView>(R.id.videoFeedView)
videoFeedView.init(viewOptions)

Use Cases

  • Featured Video - Highlight a specific video on your homepage

  • Video Details Page - Dedicated page for a single video

  • Direct Video Links - Open specific videos from deep links or notifications

  • Content Promotion - Promote a specific piece of content

  • Livestream Event - Display a specific live stream

  • Tutorial or Guide - Show a specific instructional video

Complete Examples

class HomeActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_home)
        
        val featuredVideoView = findViewById<FwVideoFeedView>(R.id.featuredVideo)
        
        val viewOptions = viewOptions {
            baseOptions {
                feedResource(
                    FeedResource.SingleContent(contentId = "encoded_video_id")
                )
            }
            playerOptions {
                showShareButton(true)
            }
        }
        
        featuredVideoView.init(viewOptions)
    }
}

Using with Fullscreen Player

Single Content Feed is particularly useful with the fullscreen player:

fun launchSpecificVideo(contentId: String) {
    val viewOptions = viewOptions {
        baseOptions {
            feedResource(
                FeedResource.SingleContent(contentId = contentId)
            )
        }
        playerOptions {
            showShareButton(true)
            showFireworkLogo(false)
        }
    }
    
    FireworkSdk.startPlayer(
        activity = this,
        viewOptions = viewOptions
    )
}

Important Notes

  • Encoded Content ID Required - Content ID must be an encoded value from Firework

  • Empty String Exception - Providing an empty contentId will throw an exception

  • Single Content Only - Only the specified video/livestream is displayed

  • No Related Videos - Unlike other feed types, no additional content is shown

  • Works with Videos and Livestreams - Supports both regular videos and livestream content

  • Content ID Format - Use the encoded ID provided by Firework CMS

See Also

Last updated

Was this helpful?