Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions library/src/main/java/cn/jzvd/JZMediaSystem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package cn.jzvd;

import android.graphics.SurfaceTexture;
import android.media.AudioManager;
import android.media.AudioAttributes;
import android.media.MediaPlayer;
import android.media.PlaybackParams;
import android.os.Handler;
Expand Down Expand Up @@ -34,7 +34,11 @@ public void prepare() {
mMediaHandler.post(() -> {
try {
mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setAudioAttributes(
new AudioAttributes
.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
.build());
mediaPlayer.setLooping(jzvd.jzDataSource.looping);
mediaPlayer.setOnPreparedListener(JZMediaSystem.this);
mediaPlayer.setOnCompletionListener(JZMediaSystem.this);
Expand Down
6 changes: 3 additions & 3 deletions library/src/main/java/cn/jzvd/Jzvd.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void onAudioFocusChange(int focusChange) {
public ViewGroup topContainer, bottomContainer;
public JZTextureView textureView;
public boolean preloading = false;
protected long gobakFullscreenTime = 0;//这个应该重写一下,刷新列表,新增列表的刷新,不打断播放,应该是个flag
protected long goNormalFullscreenTime = 0;//这个应该重写一下,刷新列表,新增列表的刷新,不打断播放,应该是个flag
protected long gotoFullscreenTime = 0;
protected Timer UPDATE_PROGRESS_TIMER;
protected int mScreenWidth;
Expand Down Expand Up @@ -687,7 +687,7 @@ public void onCompletion() {
}

public void gotoNormalCompletion() {
gobakFullscreenTime = System.currentTimeMillis();//退出全屏
goNormalFullscreenTime = System.currentTimeMillis();//退出全屏
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(jzvdContext)).getWindow().getDecorView();
vg.removeView(this);
textureViewContainer.removeView(textureView);
Expand Down Expand Up @@ -1004,7 +1004,7 @@ public void gotoFullscreen() {
}

public void gotoNormalScreen() {//goback本质上是goto
gobakFullscreenTime = System.currentTimeMillis();//退出全屏
goNormalFullscreenTime = System.currentTimeMillis();//退出全屏
ViewGroup vg = (ViewGroup) (JZUtils.scanForActivity(jzvdContext)).getWindow().getDecorView();
vg.removeView(this);
// CONTAINER_LIST.getLast().removeAllViews();
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/java/cn/jzvd/JzvdStd.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ public void init(Context context) {
}

public void setUp(JZDataSource jzDataSource, int screen, Class mediaInterfaceClass) {
if ((System.currentTimeMillis() - gobakFullscreenTime) < 200) {
if ((System.currentTimeMillis() - goNormalFullscreenTime) < 200) {
return;
}

Expand Down
10 changes: 10 additions & 0 deletions library/src/main/res/values-in/values-in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="click_to_restart">Klik untuk coba lagi</string>
<string name="no_url">Tidak ada url</string>
<string name="replay">Putar ulang</string>
<string name="tips_not_wifi">Anda sedang menggunakan jaringan seluler, Anda akan terus konsumsi data seluler</string>
<string name="tips_not_wifi_cancel">Berhenti putar</string>
<string name="tips_not_wifi_confirm">Lanjutkan</string>
<string name="video_loading_failed">Pemuatan video gagal</string>
</resources>