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

Commit d7488d4

Browse files
committed
Preparing changes for 1.2 release
1 parent 605be55 commit d7488d4

File tree

19 files changed

+1370
-1309
lines changed

19 files changed

+1370
-1309
lines changed

Diff for: .idea/compiler.xml

-22
This file was deleted.

Diff for: .idea/copyright/profiles_settings.xml

-3
This file was deleted.

Diff for: .idea/misc.xml

+5-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ The programmatic configuration options shown above can also be configured direct
400400
app:bvp_themeColor="@color/color_primary"
401401
app:bvp_captionSize="22sp"
402402
app:bvp_captionColor="@color/caption_color"
403+
app:bvp_gestureType="SwipeGesture"
403404
app:bvp_loadingStyle="DoubleBounce"
404405
app:bvp_loop="false" />
405406
```

Diff for: app/build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ android {
2020
}
2121

2222
dependencies {
23-
compile fileTree(dir: 'libs', include: ['*.jar'])
24-
compile 'com.github.halilozercan:BetterVideoPlayer:1.1.0'
25-
compile "com.android.support:appcompat-v7:$project.googleAPIsVersion"
26-
compile "com.android.support:support-compat:$project.googleAPIsVersion"
27-
compile "com.android.support:support-v4:$project.googleAPIsVersion"
23+
implementation fileTree(dir: 'libs', include: ['*.jar'])
24+
implementation project(path: ":bettervideoplayer")
25+
implementation "com.android.support:appcompat-v7:$project.googleAPIsVersion"
26+
implementation "com.android.support:support-compat:$project.googleAPIsVersion"
27+
implementation "com.android.support:support-v4:$project.googleAPIsVersion"
2828
}

Diff for: app/src/main/java/com/halilibo/sample/BackgroundActivity.java

+13-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import android.net.Uri;
44
import android.support.v7.app.AppCompatActivity;
55
import android.os.Bundle;
6+
import android.view.View;
7+
import android.widget.Toast;
68

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

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

5860
}
5961
});
62+
63+
findViewById(R.id.example_button).setOnClickListener(new View.OnClickListener() {
64+
@Override
65+
public void onClick(View v) {
66+
Toast.makeText(getApplicationContext(),
67+
"You can put a background video on your login page ;)",
68+
Toast.LENGTH_LONG)
69+
.show();
70+
}
71+
});
6072
}
6173
}

Diff for: app/src/main/java/com/halilibo/sample/MainActivity.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void onClick(View view) {
3636
}
3737
});
3838

39-
bvp = (BetterVideoPlayer) findViewById(R.id.bvp);
39+
bvp = findViewById(R.id.bvp);
4040

4141
if(savedInstanceState == null) {
4242
bvp.setAutoPlay(true);
@@ -52,17 +52,25 @@ public void onClick(View view) {
5252
public boolean onMenuItemClick(MenuItem item) {
5353
switch (item.getItemId()){
5454
case R.id.action_enable_swipe:
55-
bvp.enableSwipeGestures();
55+
bvp.enableSwipeGestures(getWindow());
56+
break;
57+
case R.id.action_enable_double_tap:
58+
bvp.enableDoubleTapGestures(5000);
5659
break;
5760
case R.id.action_disable_swipe:
58-
bvp.disableSwipeGestures();
61+
bvp.disableGestures();
5962
break;
6063
case R.id.action_show_bottombar:
6164
bvp.setBottomProgressBarVisibility(true);
6265
break;
6366
case R.id.action_hide_bottombar:
6467
bvp.setBottomProgressBarVisibility(false);
6568
break;
69+
case R.id.action_show_captions:
70+
bvp.setCaptions(R.raw.sub, CaptionsView.CMime.SUBRIP);
71+
break;
72+
case R.id.action_hide_captions:
73+
bvp.removeCaptions();
6674
}
6775
return false;
6876
}

Diff for: app/src/main/res/layout/activity_background.xml

+9
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,18 @@
2222
android:layout_width="wrap_content"
2323
android:layout_height="wrap_content"
2424
android:text="CONTENT"
25+
android:id="@+id/example_textview"
2526
android:textSize="30sp"
2627
android:layout_centerHorizontal="true"
2728
android:layout_centerVertical="true"/>
29+
30+
<Button
31+
android:id="@+id/example_button"
32+
android:layout_width="wrap_content"
33+
android:layout_height="wrap_content"
34+
android:layout_below="@+id/example_textview"
35+
android:layout_centerHorizontal="true"
36+
android:text="Buttons"/>
2837
</RelativeLayout>
2938

3039
</RelativeLayout>

Diff for: app/src/main/res/menu/menu_dizi.xml

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
xmlns:app="http://schemas.android.com/apk/res-auto">
33
<item android:id="@+id/action_enable_swipe" android:title="Enable Swipe"
44
android:orderInCategory="100" app:showAsAction="never" />
5-
<item android:id="@+id/action_disable_swipe" android:title="Disable Swipe"
5+
<item android:id="@+id/action_enable_double_tap" android:title="Enable DoubleTap"
6+
android:orderInCategory="100" app:showAsAction="never" />
7+
<item android:id="@+id/action_disable_swipe" android:title="Disable Gestures"
68
android:orderInCategory="100" app:showAsAction="never" />
79
<item android:id="@+id/action_show_bottombar" android:title="Show BottomBar"
810
android:orderInCategory="100" app:showAsAction="never" />
911
<item android:id="@+id/action_hide_bottombar" android:title="Hide BottomBar"
1012
android:orderInCategory="100" app:showAsAction="never" />
13+
<item android:id="@+id/action_show_captions" android:title="Show Captions"
14+
android:orderInCategory="100" app:showAsAction="never" />
15+
<item android:id="@+id/action_hide_captions" android:title="Hide Captions"
16+
android:orderInCategory="100" app:showAsAction="never" />
1117
</menu>

Diff for: app/src/main/res/raw/sub.srt

+17-37
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,33 @@
11
0
2-
00:00:04,170 --> 00:00:05,838
3-
<i>Subtitle 1</i>
4-
5-
1
6-
00:00:05,840 --> 00:00:06,772
7-
<i>Subtitle 2</i>
8-
9-
2
10-
00:00:06,774 --> 00:00:08,440
11-
<i>Subtitle 3</i>
12-
13-
3
14-
00:00:08,442 --> 00:00:10,109
15-
<i>Subtitle 4</i>
16-
17-
4
18-
00:00:10,111 --> 00:00:11,610
19-
<i>Subtitle 5</i>
2+
00:00:04,170 --> 00:00:11,610
3+
<i>A beautiful sky and forest</i>
204

215
5
22-
00:00:11,612 --> 00:00:12,678
23-
<i>Subtitle 6</i>
24-
25-
6
26-
00:00:12,680 --> 00:00:14,446
27-
<i>Subtitle 7</i>
6+
00:00:12,000 --> 00:00:14,446
7+
<i>Dank river</i>
288

299
7
30-
00:00:14,448 --> 00:00:18,283
31-
<i>Subtitle 8</i>
10+
00:00:15,448 --> 00:00:17,000
11+
<i>Bird singing Take on me ♬</i>
3212

3313
8
34-
00:00:18,285 --> 00:00:23,789
35-
<i>Subtitle 9</i>
14+
00:00:20,000 --> 00:00:22,000
15+
<i>360 NO SCOPE</i>
3616

3717
9
3818
00:00:23,791 --> 00:00:26,392
39-
<i>Subtitle 10</i>
19+
<i>Here are more captions</i>
4020

4121
10
4222
00:00:26,791 --> 00:00:29,392
43-
<i>Subtitle 11</i>
44-
<i>New line</i>
23+
<i>What do you</i>
24+
<i>want me to say</i>
4525

4626
11
47-
00:00:29,791 --> 00:00:45,392
48-
<i>Subtitle 12</i>
49-
50-
<i>New line</i>
51-
<i>Another new line</i>
27+
00:00:29,791 --> 00:00:33,392
28+
<i>Preparing captions is hard</i>
5229

53-
<i>Final line</i>
30+
12
31+
00:00:36,791 --> 00:00:43,392
32+
<i>Holy shit, is that a bunny?</i>
33+
<i>I'm out!!</i>

Diff for: bettervideoplayer/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ android {
2222
}
2323

2424
dependencies {
25-
compile "com.android.support:appcompat-v7:$project.googleAPIsVersion"
26-
compile "com.android.support:support-compat:$project.googleAPIsVersion"
27-
compile "com.android.support:design:$project.googleAPIsVersion"
28-
compile 'me.zhanghai.android.materialprogressbar:library:1.1.6'
29-
compile 'org.adw.library:discrete-seekbar:1.0.1'
30-
compile 'com.devbrackets.android:exomedia:3.0.1'
31-
compile 'com.github.ybq:Android-SpinKit:1.1.0'
25+
implementation "com.android.support:appcompat-v7:$project.googleAPIsVersion"
26+
implementation "com.android.support:support-compat:$project.googleAPIsVersion"
27+
implementation "com.android.support:design:$project.googleAPIsVersion"
28+
implementation 'me.zhanghai.android.materialprogressbar:library:1.1.7'
29+
implementation 'org.adw.library:discrete-seekbar:1.0.1'
30+
implementation 'com.devbrackets.android:exomedia:3.0.1'
31+
implementation 'com.github.ybq:Android-SpinKit:1.1.0'
3232
}
3333

3434
// build a jar with source files

Diff for: bettervideoplayer/src/main/java/com/halilibo/bettervideoplayer/BetterVideoCallback.java

+36
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,55 @@
66
*/
77
public interface BetterVideoCallback {
88

9+
/**
10+
* Called right after Android MediaPlayer is started
11+
* @param player
12+
*/
913
void onStarted(BetterVideoPlayer player);
1014

15+
/**
16+
* Called right after Android MediaPlayer is paused
17+
* @param player
18+
*/
1119
void onPaused(BetterVideoPlayer player);
1220

21+
/**
22+
* Called just before setting the source of Android MediaPlayer
23+
* @param player
24+
*/
1325
void onPreparing(BetterVideoPlayer player);
1426

27+
/**
28+
* Called when Android MediaPlayer is prepared
29+
* @param player
30+
*/
1531
void onPrepared(BetterVideoPlayer player);
1632

33+
/**
34+
* Called whenever Android MediaPlayer fires a BufferUpdate.
35+
* @param percent
36+
*/
1737
void onBuffering(int percent);
1838

39+
/**
40+
* Exception occurred in the player.
41+
* @param player
42+
* @param e
43+
*/
1944
void onError(BetterVideoPlayer player, Exception e);
2045

46+
/**
47+
* Called after video is completed and every action is taken by the player.
48+
* @param player
49+
*/
2150
void onCompletion(BetterVideoPlayer player);
2251

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

0 commit comments

Comments
 (0)