Skip to content
This repository has been archived by the owner on Jul 20, 2021. It is now read-only.

Commit

Permalink
Preparing changes for 1.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
halilozercan committed May 1, 2018
1 parent 605be55 commit d7488d4
Show file tree
Hide file tree
Showing 19 changed files with 1,370 additions and 1,309 deletions.
22 changes: 0 additions & 22 deletions .idea/compiler.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

22 changes: 5 additions & 17 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ The programmatic configuration options shown above can also be configured direct
app:bvp_themeColor="@color/color_primary"
app:bvp_captionSize="22sp"
app:bvp_captionColor="@color/caption_color"
app:bvp_gestureType="SwipeGesture"
app:bvp_loadingStyle="DoubleBounce"
app:bvp_loop="false" />
```
Expand Down
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
compile "com.android.support:appcompat-v7:$project.googleAPIsVersion"
compile "com.android.support:support-compat:$project.googleAPIsVersion"
compile "com.android.support:support-v4:$project.googleAPIsVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(path: ":bettervideoplayer")
implementation "com.android.support:appcompat-v7:$project.googleAPIsVersion"
implementation "com.android.support:support-compat:$project.googleAPIsVersion"
implementation "com.android.support:support-v4:$project.googleAPIsVersion"
}
14 changes: 13 additions & 1 deletion app/src/main/java/com/halilibo/sample/BackgroundActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.halilibo.bettervideoplayer.BetterVideoCallback;
import com.halilibo.bettervideoplayer.BetterVideoPlayer;
Expand All @@ -14,7 +16,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_background);

BetterVideoPlayer bvp = (BetterVideoPlayer) findViewById(R.id.bvp);
BetterVideoPlayer bvp = findViewById(R.id.bvp);
bvp.setSource(Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.video));
bvp.setCallback(new BetterVideoCallback() {
@Override
Expand Down Expand Up @@ -57,5 +59,15 @@ public void onToggleControls(BetterVideoPlayer player, boolean isShowing) {

}
});

findViewById(R.id.example_button).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),
"You can put a background video on your login page ;)",
Toast.LENGTH_LONG)
.show();
}
});
}
}
14 changes: 11 additions & 3 deletions app/src/main/java/com/halilibo/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void onClick(View view) {
}
});

bvp = (BetterVideoPlayer) findViewById(R.id.bvp);
bvp = findViewById(R.id.bvp);

if(savedInstanceState == null) {
bvp.setAutoPlay(true);
Expand All @@ -52,17 +52,25 @@ public void onClick(View view) {
public boolean onMenuItemClick(MenuItem item) {
switch (item.getItemId()){
case R.id.action_enable_swipe:
bvp.enableSwipeGestures();
bvp.enableSwipeGestures(getWindow());
break;
case R.id.action_enable_double_tap:
bvp.enableDoubleTapGestures(5000);
break;
case R.id.action_disable_swipe:
bvp.disableSwipeGestures();
bvp.disableGestures();
break;
case R.id.action_show_bottombar:
bvp.setBottomProgressBarVisibility(true);
break;
case R.id.action_hide_bottombar:
bvp.setBottomProgressBarVisibility(false);
break;
case R.id.action_show_captions:
bvp.setCaptions(R.raw.sub, CaptionsView.CMime.SUBRIP);
break;
case R.id.action_hide_captions:
bvp.removeCaptions();
}
return false;
}
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/layout/activity_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,18 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CONTENT"
android:id="@+id/example_textview"
android:textSize="30sp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"/>

<Button
android:id="@+id/example_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/example_textview"
android:layout_centerHorizontal="true"
android:text="Buttons"/>
</RelativeLayout>

</RelativeLayout>
8 changes: 7 additions & 1 deletion app/src/main/res/menu/menu_dizi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_enable_swipe" android:title="Enable Swipe"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_disable_swipe" android:title="Disable Swipe"
<item android:id="@+id/action_enable_double_tap" android:title="Enable DoubleTap"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_disable_swipe" android:title="Disable Gestures"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_show_bottombar" android:title="Show BottomBar"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_hide_bottombar" android:title="Hide BottomBar"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_show_captions" android:title="Show Captions"
android:orderInCategory="100" app:showAsAction="never" />
<item android:id="@+id/action_hide_captions" android:title="Hide Captions"
android:orderInCategory="100" app:showAsAction="never" />
</menu>
54 changes: 17 additions & 37 deletions app/src/main/res/raw/sub.srt
Original file line number Diff line number Diff line change
@@ -1,53 +1,33 @@
0
00:00:04,170 --> 00:00:05,838
<i>Subtitle 1</i>

1
00:00:05,840 --> 00:00:06,772
<i>Subtitle 2</i>

2
00:00:06,774 --> 00:00:08,440
<i>Subtitle 3</i>

3
00:00:08,442 --> 00:00:10,109
<i>Subtitle 4</i>

4
00:00:10,111 --> 00:00:11,610
<i>Subtitle 5</i>
00:00:04,170 --> 00:00:11,610
<i>A beautiful sky and forest</i>

5
00:00:11,612 --> 00:00:12,678
<i>Subtitle 6</i>

6
00:00:12,680 --> 00:00:14,446
<i>Subtitle 7</i>
00:00:12,000 --> 00:00:14,446
<i>Dank river</i>

7
00:00:14,448 --> 00:00:18,283
<i>Subtitle 8</i>
00:00:15,448 --> 00:00:17,000
<i>Bird singing Take on me ♬</i>

8
00:00:18,285 --> 00:00:23,789
<i>Subtitle 9</i>
00:00:20,000 --> 00:00:22,000
<i>360 NO SCOPE</i>

9
00:00:23,791 --> 00:00:26,392
<i>Subtitle 10</i>
<i>Here are more captions</i>

10
00:00:26,791 --> 00:00:29,392
<i>Subtitle 11</i>
<i>New line</i>
<i>What do you</i>
<i>want me to say</i>

11
00:00:29,791 --> 00:00:45,392
<i>Subtitle 12</i>

<i>New line</i>
<i>Another new line</i>
00:00:29,791 --> 00:00:33,392
<i>Preparing captions is hard</i>

<i>Final line</i>
12
00:00:36,791 --> 00:00:43,392
<i>Holy shit, is that a bunny?</i>
<i>I'm out!!</i>
14 changes: 7 additions & 7 deletions bettervideoplayer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ android {
}

dependencies {
compile "com.android.support:appcompat-v7:$project.googleAPIsVersion"
compile "com.android.support:support-compat:$project.googleAPIsVersion"
compile "com.android.support:design:$project.googleAPIsVersion"
compile 'me.zhanghai.android.materialprogressbar:library:1.1.6'
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.devbrackets.android:exomedia:3.0.1'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
implementation "com.android.support:appcompat-v7:$project.googleAPIsVersion"
implementation "com.android.support:support-compat:$project.googleAPIsVersion"
implementation "com.android.support:design:$project.googleAPIsVersion"
implementation 'me.zhanghai.android.materialprogressbar:library:1.1.7'
implementation 'org.adw.library:discrete-seekbar:1.0.1'
implementation 'com.devbrackets.android:exomedia:3.0.1'
implementation 'com.github.ybq:Android-SpinKit:1.1.0'
}

// build a jar with source files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,55 @@
*/
public interface BetterVideoCallback {

/**
* Called right after Android MediaPlayer is started
* @param player
*/
void onStarted(BetterVideoPlayer player);

/**
* Called right after Android MediaPlayer is paused
* @param player
*/
void onPaused(BetterVideoPlayer player);

/**
* Called just before setting the source of Android MediaPlayer
* @param player
*/
void onPreparing(BetterVideoPlayer player);

/**
* Called when Android MediaPlayer is prepared
* @param player
*/
void onPrepared(BetterVideoPlayer player);

/**
* Called whenever Android MediaPlayer fires a BufferUpdate.
* @param percent
*/
void onBuffering(int percent);

/**
* Exception occurred in the player.
* @param player
* @param e
*/
void onError(BetterVideoPlayer player, Exception e);

/**
* Called after video is completed and every action is taken by the player.
* @param player
*/
void onCompletion(BetterVideoPlayer player);

/**
* New: Control toggling might be of importance especially when using fullscreen.
* You might also adjust your layout or overlays according to controls' visibility.
* This method is called whenever visibility of controls is changed.
* @param player
* @param isShowing : True if controls are visible.
*/
void onToggleControls(BetterVideoPlayer player, boolean isShowing);
}
Loading

0 comments on commit d7488d4

Please sign in to comment.