-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from dev-labs-bg/refactor/library-module
Refactor/library module
- Loading branch information
Showing
12 changed files
with
191 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,35 +9,37 @@ | |
import java.io.File; | ||
|
||
import bg.devlabs.fullscreenvideoview.orientation.LandscapeOrientation; | ||
import bg.devlabs.fullscreenvideoview.orientation.OrientationDelegate; | ||
import bg.devlabs.fullscreenvideoview.orientation.OrientationHelper; | ||
import bg.devlabs.fullscreenvideoview.orientation.PortraitOrientation; | ||
|
||
/** | ||
* Created by Slavi Petrov on 25.10.2017 | ||
* Dev Labs | ||
* [email protected] | ||
*/ | ||
@SuppressWarnings("unused") | ||
@SuppressWarnings({"unused", "ClassWithTooManyMethods", "ClassNamingConvention"}) | ||
public class Builder { | ||
private final FullscreenVideoView fullscreenVideoView; | ||
private final VideoControllerView controller; | ||
private final OrientationDelegate orientationDelegate; | ||
private final OrientationHelper orientationHelper; | ||
private final VideoMediaPlayer videoMediaPlayer; | ||
|
||
Builder(FullscreenVideoView fullscreenVideoView, VideoControllerView controller, | ||
OrientationDelegate orientationDelegate, VideoMediaPlayer videoMediaPlayer) { | ||
OrientationHelper orientationHelper, VideoMediaPlayer videoMediaPlayer) { | ||
this.fullscreenVideoView = fullscreenVideoView; | ||
this.controller = controller; | ||
this.orientationDelegate = orientationDelegate; | ||
this.orientationHelper = orientationHelper; | ||
this.videoMediaPlayer = videoMediaPlayer; | ||
} | ||
|
||
void videoFile(@NonNull final File videoFile) { | ||
Builder videoFile(@NonNull File videoFile) { | ||
fullscreenVideoView.setupMediaPlayer(videoFile.getPath()); | ||
return this; | ||
} | ||
|
||
void videoUrl(@NonNull final String videoUrl) { | ||
Builder videoUrl(@NonNull String videoUrl) { | ||
fullscreenVideoView.setupMediaPlayer(videoUrl); | ||
return this; | ||
} | ||
|
||
public Builder enableAutoStart() { | ||
|
@@ -121,12 +123,12 @@ public Builder rewindSeconds(int rewindSeconds) { | |
} | ||
|
||
public Builder landscapeOrientation(LandscapeOrientation landscapeOrientation) { | ||
orientationDelegate.setLandscapeOrientation(landscapeOrientation); | ||
orientationHelper.setLandscapeOrientation(landscapeOrientation); | ||
return this; | ||
} | ||
|
||
public Builder portraitOrientation(PortraitOrientation portraitOrientation) { | ||
orientationDelegate.setPortraitOrientation(portraitOrientation); | ||
orientationHelper.setPortraitOrientation(portraitOrientation); | ||
return this; | ||
} | ||
|
||
|
Oops, something went wrong.