Skip to content

Commit c52208a

Browse files
committed
Add "spherical_view" surface type
1 parent 13885d5 commit c52208a

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<com.google.android.exoplayer2.ui.PlayerView xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent"
6+
app:surface_type="spherical_view" />

android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public class TiExoplayerModule extends KrollModule
135135
@Kroll.constant
136136
public static final int SURFACE_TYPE_TEXTURE_VIEW = 2;
137137

138+
@Kroll.constant
139+
public static final int SURFACE_TYPE_SPHERICAL_VIEW = 3;
140+
138141
private String downloadActionFile = "actions";
139142
private String downloadTrackerActionFile = "tracked_actions";
140143
private String downloadContentDirectory = "downloads";

android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ public void processProperties(KrollDict d)
193193
path = "layout.player_view_none";
194194
} else if (surfaceType == TiExoplayerModule.SURFACE_TYPE_TEXTURE_VIEW) {
195195
path = "layout.player_view_texture_view";
196+
} else if (surfaceType == TiExoplayerModule.SURFACE_TYPE_SPHERICAL_VIEW) {
197+
path = "layout.player_view_spherical_view";
196198
} else if (surfaceType != TiExoplayerModule.SURFACE_TYPE_SURFACE_VIEW) {
197199
Log.e(TAG, "Wrong \"" + TiExoplayerModule.PROPERTY_SURFACE_TYPE + "\" property value:" + surfaceType
198200
+ ". Fallback to SurfaceView");

documentation/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The `ExoPlayer` variable is a reference to the Module object.
4747
* `ExoPlayer.SURFACE_TYPE_NONE`
4848
* `ExoPlayer.SURFACE_TYPE_SURFACE_VIEW`
4949
* `ExoPlayer.SURFACE_TYPE_TEXTURE_VIEW`
50+
* `ExoPlayer.SURFACE_TYPE_SPHERICAL_VIEW`
5051

5152
## VideoPlayer
5253
For full VideoPlayer API see documentation for original [Ti.Media.VideoPlayer](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer).

0 commit comments

Comments
 (0)