Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModifyPlayer #926

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
18 changes: 13 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.seafile.seadroid2'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 119
versionName "2.2.44"
versionCode 120
versionName "2.2.45"
multiDexEnabled true
resValue "string", "authorities", applicationId + '.cameraupload.provider'
resValue "string", "account_type", "com.seafile.seadroid2.account.api2"
Expand Down Expand Up @@ -110,9 +110,17 @@ android {
testImplementation 'org.robolectric:robolectric:3.0'
implementation 'com.madgag.spongycastle:core:1.54.0.0'
implementation 'com.madgag.spongycastle:prov:1.54.0.0'
implementation 'com.shuyu:gsyVideoPlayer-java:3.0.0'
implementation 'com.shuyu:gsyVideoPlayer-ex_so:3.0.0'
implementation 'com.squareup.okhttp3:okhttp:3.9.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'

implementation 'com.shuyu:gsyVideoPlayer-ex_so:6.0.1'
implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
implementation "com.andkulikov:transitionseverywhere:1.7.4"
implementation 'com.github.maxiaoping.GSYVideoPlayer:GSYVideoPlayer:6.0.1-seafile'
implementation 'com.shuyu:gsyVideoPlayer-java:6.0.1'




implementation 'com.yydcdut:markdown-processor:0.1.3'
implementation 'ren.qinc.edit:lib:0.0.5'//editor undo redo
Expand Down
15 changes: 10 additions & 5 deletions app/src/main/java/com/seafile/seadroid2/play/PlayActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import com.seafile.seadroid2.ui.activity.BaseActivity;
import com.seafile.seadroid2.util.ConcurrentAsyncTask;
import com.seafile.seadroid2.util.Utils;
import com.shuyu.gsyvideoplayer.GSYVideoManager;
import com.shuyu.gsyvideoplayer.utils.OrientationUtils;
import com.shuyu.gsyvideoplayer.video.base.GSYVideoPlayer;

import java.io.File;

Expand Down Expand Up @@ -72,7 +72,12 @@ public void onClick(View v) {
orientationUtils.resolveByClick();
}
});

videoPlayer.getBackButton().setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onBackPressed();
}
});
videoPlayer.setUp(mFileLink, true, new File(getCacheDir().toString()), "");

// videoPlayer.getFullscreenButton().setVisibility(View.GONE);
Expand Down Expand Up @@ -129,9 +134,9 @@ public void onBackPressed() {
videoPlayer.getFullscreenButton().performClick();
return;
}
//Release resources
videoPlayer.setStandardVideoAllCallBack(null);
GSYVideoPlayer.releaseAllVideos();
//Release All resources
videoPlayer.setVideoAllCallBack(null);
GSYVideoManager.releaseAllVideos();
if (isTransition && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
super.onBackPressed();
} else {
Expand Down
33 changes: 18 additions & 15 deletions app/src/main/java/com/seafile/seadroid2/play/SampleVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import android.content.Context;
import android.graphics.Matrix;
import android.graphics.SurfaceTexture;
import android.util.AttributeSet;
import android.view.Surface;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
Expand Down Expand Up @@ -89,12 +89,23 @@ public void onClick(View v) {
/**
* It needs to be reprocessed when the size changes
*/

@Override
public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {
super.onSurfaceTextureSizeChanged(surface, width, height);
public void onSurfaceSizeChanged(Surface surface, int width, int height) {
super.onSurfaceSizeChanged(surface, width, height);
resolveTransform();
}

/**
* Processing display
*/

@Override
public void onSurfaceAvailable(Surface surface) {
super.onSurfaceAvailable(surface);
resolveRotateUI();
resolveTransform();
}

/**
* Processing mirror rotation
Expand Down Expand Up @@ -206,15 +217,7 @@ protected void resolveNormalVideoShow(View oldF, ViewGroup vp, GSYVideoPlayer gs
}
}

/**
* Processing display
*/
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
super.onSurfaceTextureAvailable(surface, width, height);
resolveRotateUI();
resolveTransform();
}


/**
* Rotation
Expand Down Expand Up @@ -242,13 +245,13 @@ private void resolveTypeUI() {
mMoreScale.setText("4:3");
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_4_3);
} else if (mType == 3) {
mMoreScale.setText("全屏");
mMoreScale.setText(R.string.player_full_screen);
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_FULL);
} else if (mType == 4) {
mMoreScale.setText("拉伸全屏");
mMoreScale.setText(R.string.player_stretch_full_screen);
GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL);
} else if (mType == 0) {
mMoreScale.setText("默认比例");
mMoreScale.setText(R.string.player_default_scale);
GSYVideoType.setShowType(GSYVideoType.SCREEN_TYPE_DEFAULT);
}
changeTextureViewShowType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public class BrowserActivity extends BaseActivity
private AccountManager accountManager;
private int currentPosition = 0;
private Intent copyMoveIntent;
private Intent monitorIntent;
private Account account;

private Intent mediaObserver;
Expand Down Expand Up @@ -387,7 +388,7 @@ public void onPageScrollStateChanged(int state) {
bindService(bIntent, mConnection, Context.BIND_AUTO_CREATE);
Log.d(DEBUG_TAG, "try bind TransferService");

Intent monitorIntent = new Intent(this, FileMonitorService.class);
monitorIntent = new Intent(this, FileMonitorService.class);
startService(monitorIntent);

requestServerInfo();
Expand Down Expand Up @@ -2448,5 +2449,12 @@ public void onEvent(CheckUploadServiceEvent result) {
} else {
Log.d(DEBUG_TAG, "onEvent============true ");
}
if (!Utils.isServiceRunning(BrowserActivity.this, "com.seafile.seadroid2.monitor.FileMonitorService")) {
monitorIntent = new Intent(this, FileMonitorService.class);
startService(monitorIntent);
Log.d(DEBUG_TAG, "FileMonitorService============false ");
} else {
Log.d(DEBUG_TAG, "FileMonitorService============true ");
}
}
}
7 changes: 7 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -548,4 +548,11 @@ E-Mail: [email protected]<br>
<string name="is_scanning">Scannen</string>
<string name="is_uploading">Hochladen</string>
<string name="network_unavailable">Netzwerk nicht verfügbar</string>
<string name="required_password">Passwort erforderlich.</string>
<string name="weak_password">Passwort ist zu schwach.</string>
<!--Player-->
<string name="jump_ad">Überspringen</string>
<string name="player_full_screen">Vollbild</string>
<string name="player_stretch_full_screen">Gestrecktes Bildformat</string>
<string name="player_default_scale">Normales Bildformat</string>
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-es-rAR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -547,4 +547,7 @@
<string name="is_scanning">Escaneando</string>
<string name="is_uploading">Subiendo</string>
<string name="network_unavailable">Red no disponible</string>
<string name="required_password">Se requiere contraseña.</string>
<string name="weak_password">La contraseña es demasiado débil.</string>
<!--Player-->
</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -547,4 +547,7 @@
<string name="is_scanning">Escaneando</string>
<string name="is_uploading">Subiendo</string>
<string name="network_unavailable">Red no disponible</string>
<string name="required_password">Se requiere contraseña.</string>
<string name="weak_password">La contraseña es demasiado débil.</string>
<!--Player-->
</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -546,4 +546,11 @@ E-mail : [email protected]<br>
<string name="is_scanning">Balayage</string>
<string name="is_uploading">Envoi</string>
<string name="network_unavailable">Réseau indisponible</string>
<string name="required_password">Un mot de passe est requis.</string>
<string name="weak_password">Le mot de passe est trop faible.</string>
<!--Player-->
<string name="jump_ad">Passer</string>
<string name="player_full_screen">Plein écran</string>
<string name="player_stretch_full_screen">Étirer en plein écran</string>
<string name="player_default_scale">Échelle par défaut</string>
</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -565,4 +565,11 @@
<string name="is_scanning">Сканирование</string>
<string name="is_uploading">Загрузка</string>
<string name="network_unavailable">Сеть недоступна</string>
<string name="required_password">Необходим пароль.</string>
<string name="weak_password">Пароль слишком слабый.</string>
<!--Player-->
<string name="jump_ad">Пропустить</string>
<string name="player_full_screen">на весь экран</string>
<string name="player_stretch_full_screen">растянуть на весь экран</string>
<string name="player_default_scale">масштаб по умолчанию</string>
</resources>
5 changes: 5 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -540,4 +540,9 @@
<string name="network_unavailable">网络不可用</string>
<string name="required_password">需要密码</string>
<string name="weak_password">密码太弱</string>
<!--Player-->
<string name="jump_ad">跳过</string>
<string name="player_full_screen">全屏</string>
<string name="player_stretch_full_screen">拉伸全屏</string>
<string name="player_default_scale">默认比例</string>
</resources>
7 changes: 7 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -569,4 +569,11 @@

<string name="required_password">Password is required.</string>
<string name="weak_password">Password is too weak.</string>

<!--Player-->
<string name="jump_ad">Skip</string>
<string name="player_full_screen">full screen</string>
<string name="player_stretch_full_screen">stretch full screen</string>
<string name="player_default_scale">default scale</string>

</resources>