Story Block (iOS)
Display Story Block
Use FWSStoryBlockView
import UIKit
import FireworkVideo
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.addStoryBlockView()
}
func addStoryBlockView() {
let storyBlockView = FWSStoryBlockView(source: .discover)
// Please ensure that viewConfiguration and isPictureInPictureEnabled are set
// before attaching it to the parent view
storyBlockView.viewConfiguration = getStoryBlockConfiguration()
storyBlockVC.isPictureInPictureEnabled = true
storyBlockView.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(storyBlockView)
NSLayoutConstraint.activate([
storyBlockView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
storyBlockView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
storyBlockView.heightAnchor.constraint(equalToConstant: 500),
storyBlockView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor)
])
}
func getStoryBlockConfiguration() -> StoryBlockConfiguration {
var viewConfiguration = StoryBlockConfiguration()
viewConfiguration.playbackButton.isHidden = false
viewConfiguration.fullScreenPlayerView.playbackButton.isHidden = false
return viewConfiguration
}
}Use FWSStoryBlockSwiftUIView (SwiftUI)
Story Block Content Source
Channel
Channel Playlist
Dynamic Content
Hashtag Playlist
SKU Playlist
Single Video or Live Stream
Video Ads
Channel Videos
Receive story block events
Play and pause StoryBlock programmatically
Use StoryBlockViewController
Use FWSStoryBlockView
Use FWSStoryBlockSwiftUIView
Viewport-based autoplay support
Customize viewport
Player configurations
Story block layout
Vertical layout

Horizontal layout

Loading indicator color
Last updated
Was this helpful?