Function Introduction
The VR playback component can be used for VR panoramic video playback. During playback, the viewing angle can be changed by gyroscope rotation or gesture operations, allowing for 360-degree unobstructed viewing of panoramic videos. Currently, the VR playback component supports configuring monocular or binocular modes. Monocular mode is suitable for naked-eye viewing of panoramic videos, while binocular mode is suitable for viewing with VR glasses and other devices. In addition, the iOS side supports 180-degree hemispherical panoramic videos, which can adapt to more usage scenarios.
Conditions for Use
Currently, the VR playback plugin can be used with mobile player SDK version 11.3 and above, as well as the mobile player SDK (Advanced Edition).
Operation Steps
Step 1: Obtain the Plugin
1. The VR playback plugin (hereinafter referred to as the "plugin") is provided as a separate SDK, which you can integrate into your project based on your project requirements. The download address is as follows:
2. Integrate the downloaded "plugin plugin_monet-release-v.x.x.x.aar" or "TXCMonetPlugin-release-v.x.x.x.framework" (where x.x.x. is the version number) into the project. After starting the player instance, the host will automatically load the plugin.
Step 2: Initialize License
String licenseUrl = "Enter the URL of the License you purchased";
String licenseKey = "Enter the Key of the License you purchased"
TXLiveBase.getInstance().setLicence(context, licenseUrl, licenseKey);
NSString *licenseURL = "Enter the URL of the License you purchased";
NSString *licenseKey = "Enter the Key of the License you purchased"
[TXLiveBase setLicenceURL:licenseURL key:licenseKey];
Step 3: Enable or disable the terminal's VR panoramic video capability
After starting playback (it is recommended to call after receiving the TXLiveConstants.PLAY_EVT_VOD_PLAY_PREPARED event), you can enable and disable the VR panoramic video through the following interface in TXVodPlayer:
@Override
public void onPlayEvent(TXVodPlayer player, int event, Bundle param) {
if (event == TXLiveConstants.PLAY_EVT_VOD_PLAY_PREPARED) {
mVodPlayer.setStringOption("PARAM_MODULE_TYPE", 11);
}
}
mVodPlayer.setStringOption("PARAM_MODULE_TYPE", 0);
NSMutableDictionary *extInfoMap = [NSMutableDictionary dictionary];
[extInfoMap setObject:@"11" forKey:@"PARAM_MODULE_TYPE"];
[_txVodPlayer setExtentOptionInfo:extInfoMap];
[extInfoMap setObject:@"0" forKey:@"PARAM_MODULE_TYPE"];
Plugin loading configuration
After adding the terminal ultra-fast HD plugin to the project, it will be automatically loaded by default. If you do not want the player to load this plugin, you can turn it off as follows:
TXVodPlayConfig playConfig = new TXVodPlayConfig();
playConfig.mEnableRenderProcess = false;
mVodPlayer.setConfig(playConfig);
TXVodPlayConfig *playConfig = [[TXVodPlayConfig alloc] init];
playConfig.enableRenderProcess = NO;
[_txVodPlayer setConfig:playConfig];
Setting obfuscation rules
In the proguard-rules.pro file, add the terminal ultra-fast HD related classes to the non-obfuscation list (iOS is not obfuscated by default):
-keep class com.tencent.** { *; }
Log viewing
1. Terminal VR panoramic video plugin load success log:
D/HostEngine-PluginManger: [loadPlugin], succeed loading pluginId=2 ,pluginClazzName=com.tencent.liteav.monet.MonetPlugin
2. VR panoramic video feature successfully enabled log:
D/MonetPlugin-Process: [updateModule], moduleType=11
3. If the following log appears, it indicates that the issued License is invalid:
E/MonetPlugin-Process: [updateModule], error, reason = license is invalid!!
1. Terminal VR panoramic video plugin load success log:
[PluginsSDK] plugin config : pluginId = 2, pluginName = Monet
2. VR panoramic video feature successfully enabled log:
[MonetProcessor] PLUGIN: did update monet module, result = 1
3. If the following log appears, it indicates that the issued License is invalid:
[MonetProcessor] Monet License invalid, error, set module is null
Was this page helpful?