From c52208a9a74b1b43c765bcc2852200b29d9ae1ca Mon Sep 17 00:00:00 2001 From: Sergey Volkov Date: Thu, 28 Mar 2019 12:00:52 +0300 Subject: [PATCH] Add "spherical_view" surface type --- .../app/src/main/res/layout/player_view_spherical_view.xml | 6 ++++++ .../src/ru/netris/mobile/exoplayer/TiExoplayerModule.java | 3 +++ android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java | 2 ++ documentation/index.md | 1 + 4 files changed, 12 insertions(+) create mode 100644 android/app/src/main/res/layout/player_view_spherical_view.xml diff --git a/android/app/src/main/res/layout/player_view_spherical_view.xml b/android/app/src/main/res/layout/player_view_spherical_view.xml new file mode 100644 index 0000000..a3a1090 --- /dev/null +++ b/android/app/src/main/res/layout/player_view_spherical_view.xml @@ -0,0 +1,6 @@ + + diff --git a/android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java b/android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java index e217d06..c054d78 100644 --- a/android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java +++ b/android/src/ru/netris/mobile/exoplayer/TiExoplayerModule.java @@ -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"; diff --git a/android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java b/android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java index c7498a1..0dd3e13 100644 --- a/android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java +++ b/android/src/ru/netris/mobile/exoplayer/TiUIVideoView.java @@ -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"); diff --git a/documentation/index.md b/documentation/index.md index b7fab88..e743af2 100644 --- a/documentation/index.md +++ b/documentation/index.md @@ -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).