Detail Player
When a video item is clicked, a detailed video screen will open to play the chosen video. You can navigate between items by swipe up and down gesture. This screen supports various features including product view, Q&A, polling, video seeking, and Picture-in-Picture (PIP). The Detail Player is an internal controller, which cannot be modified, but its UI and player behavior can be configured through configuration.detailConfiguration
. If you wish to prevent this screen from appearing, set configuration.detailConfiguration = nil
. The following attributes within the detailConfiguration
can be adjusted:
- Allow scroll
- Background color
- Previous button (set to nil to hide it)
- Next button (set to nil to hide it)
- Close button (set to nil to hide it)
Detail Player Item
For customization of individual items within the detail player, the LORA Short Video SDK
provides the following attributes:
- Background color
- Corner radius
- Title
- Progress seekbar
- Play/pause button
- Mute/unmute button
- PIP button
- Share button
- Thumbnail scale mode
- Video scale mode
Product Item
A list of products can be linked to a video item and displayed in detail. Each product item can include a Shop CTA (Call to Action) button that opens the product URL in an external browser (this behavior can be overridden). The product item's UI can be customized with attributes such as:
- Background color
- Corner radius
- Title
- CTA button: Text, Color, Image
- Thumbnail scale mode
Q&A Item
A Q&A can be associated with a video item and shown in detail. Each Q&A item contains a CTA (Call to Action) button to submit an answer. The Q&A item's UI can be customized, including:
- CTA button: Text Color, Background Color
Poll Item
A Poll can be linked to a video item and displayed in detail. Each Poll item contains a CTA button to submit an answer. The Poll item's UI can be customized, such as:
- CTA button: Text Color, Background Color
Landscape layout
By default, the detail player renders the UI according to the orientation of the current user's device. The SDK smoothly transitions between orientation modes, switching from portrait to landscape and vice versa without interrupting the player. However, you can also enforce a fixed orientation (portrait or landscape) using the SDK.
let configuration = ShortVideoConfiguration()
configuration.detailConfiguration?.layout.orientationMode = .landscape
Supported orientation modes
auto
: Automatically adjust the orientation based on the device's orientation.portrait
: Enforce a portrait orientation.landscape
: Enforce a landscape orientation.
Picture in Picture (PiP)
The detail player supports playing a video in Picture in Picture (PiP) mode, there are 2 type of PIPs supported by LORA Short Video SDK
:
- Native PIP (supported by Apple), available on iOS 14 and above
- Custom PIP, iOS below 14.
You can disable this feature by hiding the PIP button (set it to nil
).
When a video is playing in this mode, it will always loop regardless of the player completion action.