Videos Inline Player - iOS
The Blaze Videos Inline Player is a flexible component for embedding video content within your iOS application. It provides a video playback experience that can be integrated into any UI context, from dedicated video screens to scrolling feeds. The player is framework-agnostic at its core, with specialized wrappers for both UIKit and SwiftUI integration. Use it in a scrolling feed or as a standalone player in any shape, place, or form.
Key features
- Display modes: choose between interactive mode (full controls) or preview mode (minimal overlay)
- Seamless transitions: smooth transitions between inline and full screen states while maintaining playback continuity
- Placeholder support: display thumbnail images that can be tapped to start playback
- Comprehensive controls: play/pause, seek, mute, share, like, and fullscreen functionality
- Rich customization: extensive styling options for colors, buttons, text, and layout
- Lifecycle management: automatic handling of player creation, embedding, and cleanup
- Event delegation: event notifications for player state changes and user interactions
- Performance optimized: efficient resource management for smooth scrolling in feed contexts
Implementation approaches
UIKit integration
Use the BlazeVideosInlinePlayer class directly with UIKit view controllers:
let player = BlazeVideosInlinePlayer(
playerMode: .interactive(interactivePlyerStyle: .base()),
dataSourceType: .labels(.singleLabel("highlights")),
containerIdentifier: "main-player"
)
// Embed as placeholder or active player
player.embedPlayer(
in: containerViewController,
containerView: videoContainerView,
shouldAutoPlayOnStart: true
)SwiftUI integration
Use the BlazeSwiftUIVideosInlinePlayerView struct in SwiftUI views:
BlazeSwiftUIVideosInlinePlayerView(
configuration: config,
playerController: playerController,
embeddedState: .placeholder
)
.inlinePlayerDelegate(myDelegate)Player modes
Interactive mode
A fully interactive inline player with comprehensive overlay controls, including play/pause, seek bar, mute, share, and fullscreen buttons. Ideal for dedicated video viewing areas where users want full control over playback.
Preview mode
A minimal overlay player that shows a streamlined interface with only essential controls. Any interaction outside the minimal buttons will automatically open a full screen player. Perfect for video feeds, lists, or thumbnails where space is limited.
Styling system
The player offers extensive customization options through a comprehensive styling system:
- Background colors: customize the player background
- Button styling: control visibility, colors, and sizes of all player buttons
- Text styling: configure heading text appearance and visibility
- Seek bar: customize the appearance and behavior of the playback progress bar
- CTA buttons: add and style call-to-action buttons
Best practices
- Use unique identifiers: always provide unique container identifiers for proper analytics tracking and player management. For SwiftUI it is especially crucial to provide a stable identifier to prevent unintentional recreations of the player.
- Choose appropriate modes: use interactive mode for focused video viewing and preview mode for feeds
- Handle lifecycle events: implement delegate methods to respond to player events like loading completion and errors
- Optimize for scrolling: in feed contexts, consider using placeholders until a video is actively viewed
- Customize thoughtfully: apply styling that matches your app's design language while maintaining usability
- Manage the player's lifecycle: think carefully about who should own the playerController and how you tie its lifecycle to the owner
The Blaze Videos Inline Player provides a robust foundation for video playback needs across any iOS application, regardless of the UI framework used.
Updated 11 days ago
