If you're working with another partner who handles the setup and management of your video campaigns, Firework can support displaying those ads and configuring them as well. Our SDK will retrieve the ad videos from your partner and display them in the channel.
Example code snippet for Video Ads Feed and StoryBlock
Kotlin Java
Copy
val channelId = "Encoded channel id"
val vastXML = "Vast XML"
val viewOptionsForStoryBlock = viewOptions {
baseOptions {
feedResource (FeedResource. VideoADs (channelId, vastXML))
}
storyBlockOptions {
showFullScreenIcon ( true )
enableAutoPlay ( true )
}
playerOptions {
showCaption ( true )
showPlayPauseButtonInVideo ( true )
}
adBadgeOptions {
adBadgeIsHidden ( false )
}
}
val storyBlock = findViewById < FwStoryBlockView > (R.id.storyblock)
storyBlock. init (
fragmentManager = supportFragmentManager,
lifecycle = lifecycle,
viewOptions = viewOptions,
pauseWhenNotVisible = true ,
)
Copy BaseOption baseOption = new BaseOption . Builder ()
. feedResource ( new FeedResource . VideoADs ( "Encoded channel id" , "Vast XML" ))
. build ();
LayoutOption layoutOption = new LayoutOption . Builder ()
. feedLayout ( FeedLayout . HORIZONTAL )
. build ();
ViewOptions viewOptions = new ViewOptions . Builder ()
. baseOption (baseOption)
. layoutOption (layoutOption)
. build ();
FwStoryBlockView storyBlock = findViewById < FwStoryBlockView > ( R . id . storyBlock );
storyBlock . init ( getSupportFragmentManager() , getLifecycle() , viewOptions , storyBlockContainer);
Please refer to the Encoded IDs help article to learn about how to find your encoded channel ID
Last updated 3 months ago