| Interface info |
|---|
| public interface com.huawei.hms.panorama.PanoramaInterface.PanoramaLocalInterface API for panorama display in an app. |
| Return | Method |
|---|---|
| int | Initializes an API in an app. |
| View | Obtains the view for displaying a panorama. |
| int | Sets a panorama and a format. |
Surface | Obtains the surface used for video display. |
| int | setValue(String name, String value) Sets attributes. |
| String | Obtains attribute values. |
| void | Sets the mode for controlling a panorama when it is viewed. |
| void | updateTouchEvent(MotionEvent event) Updates a touch event, which is valid only in touch mode. |
| void | Deinitializes the API in the app and destroys the resources. |
| Method |
|---|
int init(); Initializes an API in an app. |
Return
| Type | Description |
|---|---|
int | If the operation is successful, value ResultCode.SUCCESS is returned. Otherwise, an error code is returned. |
| Method |
|---|
View getView() Obtains the view for displaying a panorama. You can add the view to your own layout based on the actual requirements. |
Return
| Type | Description |
|---|---|
View | View for rendering a panorama. |
| Method |
|---|
int setImage(Uri uri, int type) Sets a panorama and a format. |
Parameters
| Parameter | Description |
|---|---|
uri | URI of the panorama to be loaded. Three URIs starting with file, content, and android.resourceare supported. |
type | Panorama type. Currently, spherical(IMAGE_TYPE_SPHERICAL) and cylindrical(IMAGE_TYPE_RING) panoramas are supported. |
Return
| Type | Description |
|---|---|
int | If the operation is successful, value ResultCode.SUCCESS is returned. Otherwise, an error code is returned. |
| Method |
|---|
Surface getSurface(int type); Obtains the surface used for video display. |
Parameters
| Parameter | Description |
|---|---|
| type | Type of images decoded from video. |
Return
| Type | Description |
|---|---|
| Surface | Surface that displays video images decoded by the video player. |
| Method |
|---|
int setValue(String name, String value) Sets attributes. |
Parameter
| Parameter | Description |
|---|---|
name | Name of the attribute to be set. |
value | Value of the attribute to be set |
Return
| Type | Description |
|---|---|
int | If the API is called successfully, ResultCode.SUCCEED is returned. Otherwise, an error code is returned. |
| Method |
|---|
String getValue(String name) Obtains attribute values. |
Parameter
| Parameter | Description |
|---|---|
name | Name of the attribute whose value is to be obtained. |
Return
| Type | Description |
|---|---|
String | If the API is called successfully, the attribute value is returned. If the API fails to be called or the attribute value cannot be obtained, an empty string is returned. |
Note:
Names of attribute names that can be obtained in this version.
| Parameter | Description |
|---|---|
Rendering mode. | |
| KEY_CURRENT_AZIMUTH | Current azimuth. |
| KEY_CURRENT_HORIZONTAL_FOV | Current horizontal FOV. |
| Method |
|---|
void setControlMode(int mode) Sets the mode for controlling a panorama when it is viewed,which can be dynamically changed. |
Parameter
| Parameter | Description |
|---|---|
mode | Sets the mode for controlling a panorama when it is viewed. Currently, motion tracking control and touch mode are supported. You need to call updateTouchEvent for the touch mode. |
| Method |
|---|
void updateTouchEvent(MotionEvent event) Updates a touch event, which is valid only in touch mode. |
Parameter
| Parameter | Description |
|---|---|
event | Standard touch event of Android. The touch position is calculated by using the upper left corner of the panorama view control as the origin (0,0). The event can be passed through OnTouchListener of the view. You can process the touch event required by an upper-layer app and transfer other events tothe SDK for processing. |
| Method |
|---|
void deInit() Deinitializes the API in the app and destroys the resources. |
Return
| Type | Description |
|---|---|
int | If the operation is successful, value ResultCode.SUCCEED is returned. Otherwise, an error code is returned. |