Skip to content

Commit

Permalink
Add "spherical_view" surface type
Browse files Browse the repository at this point in the history
  • Loading branch information
drauggres committed Feb 28, 2020
1 parent 13885d5 commit c52208a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.exoplayer2.ui.PlayerView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:surface_type="spherical_view" />
3 changes: 3 additions & 0 deletions android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ public class TiExoplayerModule extends KrollModule
@Kroll.constant
public static final int SURFACE_TYPE_TEXTURE_VIEW = 2;

@Kroll.constant
public static final int SURFACE_TYPE_SPHERICAL_VIEW = 3;

private String downloadActionFile = "actions";
private String downloadTrackerActionFile = "tracked_actions";
private String downloadContentDirectory = "downloads";
Expand Down
2 changes: 2 additions & 0 deletions android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ public void processProperties(KrollDict d)
path = "layout.player_view_none";
} else if (surfaceType == TiExoplayerModule.SURFACE_TYPE_TEXTURE_VIEW) {
path = "layout.player_view_texture_view";
} else if (surfaceType == TiExoplayerModule.SURFACE_TYPE_SPHERICAL_VIEW) {
path = "layout.player_view_spherical_view";
} else if (surfaceType != TiExoplayerModule.SURFACE_TYPE_SURFACE_VIEW) {
Log.e(TAG, "Wrong \"" + TiExoplayerModule.PROPERTY_SURFACE_TYPE + "\" property value:" + surfaceType
+ ". Fallback to SurfaceView");
Expand Down
1 change: 1 addition & 0 deletions documentation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The `ExoPlayer` variable is a reference to the Module object.
* `ExoPlayer.SURFACE_TYPE_NONE`
* `ExoPlayer.SURFACE_TYPE_SURFACE_VIEW`
* `ExoPlayer.SURFACE_TYPE_TEXTURE_VIEW`
* `ExoPlayer.SURFACE_TYPE_SPHERICAL_VIEW`

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

0 comments on commit c52208a

Please sign in to comment.