Video Feed (iOS)
Display Video Feed
Use FWSVideoFeedView
import UIKit
import FireworkVideo
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
self.addVideoFeedView()
}
func addVideoFeedView() {
let channelID = "<Encoded Channel ID>"
let playlistID = "<Encoded Playlist ID>"
let videoFeedView = FWSVideoFeedView(source: .channelPlaylist(channelID: channelID, playlistID: playlistID))
videoFeedView.viewConfiguration = getVideoFeedContentConfiguration()
videoFeedView.translatesAutoresizingMaskIntoConstraints = false
self.view.addSubview(videoFeedView)
NSLayoutConstraint.activate([
videoFeedView.leadingAnchor.constraint(equalTo: self.view.leadingAnchor),
videoFeedView.trailingAnchor.constraint(equalTo: self.view.trailingAnchor),
videoFeedView.heightAnchor.constraint(equalToConstant: 240),
videoFeedView.centerYAnchor.constraint(equalTo: self.view.centerYAnchor)
])
}
func getVideoFeedContentConfiguration() -> VideoFeedContentConfiguration {
var viewConfiguration = VideoFeedContentConfiguration()
viewConfiguration.itemView.autoplay.isEnabled = true
viewConfiguration.playerView.playbackButton.isHidden = false
return viewConfiguration
}
}Use FWSVideoFeedSwiftUIView(SwiftUI)
Content Source
Custom Call-To-Action Button Handling
Force Refresh
Receive video feed events
Viewport-based autoplay support
Code snippets for FWSVideoFeedView
Code snippets for FWSVideoFeedSWiftUIView
Customize viewport
Video feed configurations
Player configurations
Last updated
Was this helpful?