tencent cloud

Feedback

VR Playback Plugin

Last updated: 2024-12-02 10:05:59

    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).
    VR playback requires obtaining the advanced version of the mobile player License to use.

    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:
    Terminal Category
    SDK Download Address
    Android Side
    VR plugin
    iOS Side
    VR plugin
    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

    To use the VR playback function, you need to use the advanced version of the mobile player License.. You can refer to the mobile player License guide to obtain it. If you have obtained the corresponding License, you can go to VOD Console > License Management > Mobile License to get the corresponding LicenseURL and LicenseKey, and then initialize the License through the following interface.
    Android
    iOS
    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:
    Android
    iOS
    @Override
    public void onPlayEvent(TXVodPlayer player, int event, Bundle param) {
    if (event == TXLiveConstants.PLAY_EVT_VOD_PLAY_PREPARED) {
    // Enable the terminal VR panoramic video monocular mode. If you need to enable the binocular mode, set the value to '12'.
    mVodPlayer.setStringOption("PARAM_MODULE_TYPE", 11);
    }
    
    
    }
    
    
    // Disable terminal VR panoramic video.
    mVodPlayer.setStringOption("PARAM_MODULE_TYPE", 0);
    // Enable VR panoramic video monocular mode. If you need to enable the binocular mode, set the value to '12'.
    // Note: The settings for enabling VR panoramic video need to be set before the player starts playing, or if you set them during the playback process, you need to restart the playback after the setting.
    // It is recommended to add a switch animation here.
    NSMutableDictionary *extInfoMap = [NSMutableDictionary dictionary];
    [extInfoMap setObject:@"11" forKey:@"PARAM_MODULE_TYPE"];
    [_txVodPlayer setExtentOptionInfo:extInfoMap];
    
    // Disable terminal VR panoramic video.
    [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:
    Android
    iOS
    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

    Android
    iOS
    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
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support