diff --git a/library/release.gradle b/library/release.gradle index aebbb93..05acf74 100644 --- a/library/release.gradle +++ b/library/release.gradle @@ -5,7 +5,7 @@ apply from: 'keystore.gradle' ext { publishedGroupId = 'bg.devlabs.fullscreenvideoview' artifactId = 'library' - libraryVersion = '0.0.1' + libraryVersion = '0.0.2' } version = libraryVersion @@ -58,7 +58,6 @@ if (project.hasProperty("android")) { task javadocJar(type: Jar, dependsOn: javadoc) { classifier = 'javadoc' from javadoc.destinationDir - // options.encoding = 'UTF-8' } artifacts { diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/Builder.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/Builder.java index 27b22ef..9671ed6 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/Builder.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/Builder.java @@ -36,12 +36,12 @@ void videoFile(@NonNull final File videoFile) { fullscreenVideoView.setupMediaPlayer(videoFile.getPath()); } - void videoPath(@NonNull final String videoPath) { - fullscreenVideoView.setupMediaPlayer(videoPath); + void videoUrl(@NonNull final String videoUrl) { + fullscreenVideoView.setupMediaPlayer(videoUrl); } - public Builder autoStartEnabled(boolean isAutoStartEnabled) { - fullscreenVideoView.setAutoStartEnabled(isAutoStartEnabled); + public Builder enableAutoStart() { + fullscreenVideoView.enableAutoStart(); return this; } @@ -130,18 +130,18 @@ public Builder portraitOrientation(PortraitOrientation portraitOrientation) { return this; } - public Builder setCanPause(boolean isPauseEnabled) { - videoMediaPlayer.setCanPause(isPauseEnabled); + public Builder canPause(boolean canPause) { + videoMediaPlayer.setPauseEnabled(canPause); return this; } - public Builder setCanSeekBackward(boolean isSeekBackwardEnabled) { - videoMediaPlayer.setCanSeekBackward(isSeekBackwardEnabled); + public Builder canSeekBackward(boolean canSeekBackward) { + videoMediaPlayer.setCanSeekBackward(canSeekBackward); return this; } - public Builder setCanSeekForward(boolean isSeekForwardEnabled) { - videoMediaPlayer.setCanSeekForward(isSeekForwardEnabled); + public Builder canSeekForward(boolean canSeekForward) { + videoMediaPlayer.setCanSeekForward(canSeekForward); return this; } diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/FullscreenVideoView.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/FullscreenVideoView.java index f64abd9..7dfbc6a 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/FullscreenVideoView.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/FullscreenVideoView.java @@ -108,10 +108,10 @@ public Builder build(File videoFile) { return builder; } - public Builder build(String videoPath) { + public Builder build(String videoUrl) { builder = new Builder(this, controller, orientationDelegate, videoMediaPlayer); - builder.videoPath(videoPath); + builder.videoUrl(videoUrl); return builder; } @@ -224,8 +224,8 @@ void toggleFullscreen() { orientationDelegate.toggleFullscreen(); } - void setAutoStartEnabled(boolean autoStartEnabled) { - videoMediaPlayer.setAutoStartEnabled(autoStartEnabled); + void enableAutoStart() { + videoMediaPlayer.enableAutoStart(); } private class VideoOnKeyListener implements View.OnKeyListener { diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoControllerView.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoControllerView.java index a8e78ab..4cbc1ef 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoControllerView.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoControllerView.java @@ -272,7 +272,7 @@ private void disableUnsupportedButtons() { } } catch (IncompatibleClassChangeError ex) { // We were given an old version of the interface, that doesn't have - // the setCanPause/canSeekXYZ methods. This is OK, it just means we + // the canPause/canSeekXYZ methods. This is OK, it just means we // assume the media can be paused and seeked, and so we don't disable // the buttons. ex.printStackTrace(); diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoMediaPlayer.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoMediaPlayer.java index a200fbf..9b1d954 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoMediaPlayer.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/VideoMediaPlayer.java @@ -54,23 +54,23 @@ void onDetach() { release(); } - public boolean isAutoStartEnabled() { + boolean isAutoStartEnabled() { return isAutoStartEnabled; } - public void setAutoStartEnabled(boolean autoStartEnabled) { - isAutoStartEnabled = autoStartEnabled; + void enableAutoStart() { + isAutoStartEnabled = true; } - public void setCanPause(boolean canPause) { + void setPauseEnabled(boolean canPause) { this.canPause = canPause; } - public void setCanSeekBackward(boolean canSeekBackward) { + void setCanSeekBackward(boolean canSeekBackward) { this.canSeekBackward = canSeekBackward; } - public void setCanSeekForward(boolean canSeekForward) { + void setCanSeekForward(boolean canSeekForward) { this.canSeekForward = canSeekForward; } } diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/LandscapeOrientation.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/LandscapeOrientation.java index dbcbc76..4a8e913 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/LandscapeOrientation.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/LandscapeOrientation.java @@ -12,7 +12,7 @@ @SuppressWarnings("unused") public enum LandscapeOrientation { SENSOR(SCREEN_ORIENTATION_SENSOR_LANDSCAPE), - LANDSCAPE(SCREEN_ORIENTATION_LANDSCAPE), + DEFAULT(SCREEN_ORIENTATION_LANDSCAPE), REVERSE(SCREEN_ORIENTATION_LANDSCAPE), USER(SCREEN_ORIENTATION_USER_LANDSCAPE); diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/OrientationDelegate.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/OrientationDelegate.java index cf6af13..73e45bd 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/OrientationDelegate.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/OrientationDelegate.java @@ -40,7 +40,7 @@ public abstract class OrientationDelegate extends OrientationEventListener { private final ContentResolver contentResolver; // Orientation private LandscapeOrientation landscapeOrientation = LandscapeOrientation.SENSOR; - private PortraitOrientation portraitOrientation = PortraitOrientation.PORTRAIT; + private PortraitOrientation portraitOrientation = PortraitOrientation.DEFAULT; private boolean shouldEnterPortrait; protected OrientationDelegate(Context context, FullscreenVideoView fullscreenVideoView) { diff --git a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/PortraitOrientation.java b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/PortraitOrientation.java index 46d8a87..3e9d16f 100644 --- a/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/PortraitOrientation.java +++ b/library/src/main/java/bg/devlabs/fullscreenvideoview/orientation/PortraitOrientation.java @@ -13,7 +13,7 @@ @SuppressWarnings("unused") public enum PortraitOrientation { SENSOR(SCREEN_ORIENTATION_SENSOR_PORTRAIT), - PORTRAIT(SCREEN_ORIENTATION_PORTRAIT), + DEFAULT(SCREEN_ORIENTATION_PORTRAIT), REVERSE(SCREEN_ORIENTATION_REVERSE_PORTRAIT), USER(SCREEN_ORIENTATION_USER_PORTRAIT); diff --git a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ActionBarActivity.kt b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ActionBarActivity.kt index c726eec..83c7806 100644 --- a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ActionBarActivity.kt +++ b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ActionBarActivity.kt @@ -29,12 +29,12 @@ class ActionBarActivity : AppCompatActivity() { supportActionBar?.title = getString(R.string.action_bar_activity) val videoPath = "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" - fullscreenVideoView.build(videoPath) + fullscreenVideoView.videoUrl(videoPath) .progressBarColor(R.color.colorAccent) - .autoStartEnabled(true) + .enableAutoStart() .landscapeOrientation(LandscapeOrientation.SENSOR) - .portraitOrientation(PortraitOrientation.PORTRAIT) - .setCanSeekBackward(false) - .setCanSeekForward(false) + .portraitOrientation(PortraitOrientation.DEFAULT) + .canSeekForward(false) + .canSeekBackward(false) } } \ No newline at end of file diff --git a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/NoActionBarActivity.kt b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/NoActionBarActivity.kt index 619842d..57e95cd 100644 --- a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/NoActionBarActivity.kt +++ b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/NoActionBarActivity.kt @@ -18,6 +18,6 @@ class NoActionBarActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_no_action_bar) val videoPath = "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" - fullscreenVideoView.build(videoPath) + fullscreenVideoView.videoUrl(videoPath) } } diff --git a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/RegularActivity.kt b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/RegularActivity.kt index 20c61a1..e3b3ed8 100644 --- a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/RegularActivity.kt +++ b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/RegularActivity.kt @@ -18,6 +18,6 @@ class RegularActivity : Activity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_regular) val videoPath = "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" - fullscreenVideoView.build(videoPath) + fullscreenVideoView.videoUrl(videoPath) } } diff --git a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ToolbarActivity.kt b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ToolbarActivity.kt index 66d164a..33dff60 100644 --- a/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ToolbarActivity.kt +++ b/sample/src/main/java/bg/devlabs/fullscreenvideoviewsample/ToolbarActivity.kt @@ -18,6 +18,6 @@ class ToolbarActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_toolbar) val videoPath = "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" - fullscreenVideoView.build(videoPath) + fullscreenVideoView.videoUrl(videoPath) } }