mirror of
https://github.com/jellyfin/jellyfin-androidtv.git
synced 2025-05-17 19:36:03 +08:00
Merge pull request #651 from nielsvanvelzen/0.11.5-cherries
Freshly picked cherries for 0.11.5
This commit is contained in:
@ -13,8 +13,8 @@ android {
|
|||||||
targetSdkVersion(29)
|
targetSdkVersion(29)
|
||||||
|
|
||||||
// Release version
|
// Release version
|
||||||
versionCode = 909
|
versionCode = 910
|
||||||
versionName = "0.11.4"
|
versionName = "0.11.5"
|
||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
@ -67,7 +67,7 @@ dependencies {
|
|||||||
|
|
||||||
// Media players
|
// Media players
|
||||||
implementation("com.amazon.android:exoplayer:2.11.3")
|
implementation("com.amazon.android:exoplayer:2.11.3")
|
||||||
implementation("org.videolan.android:libvlc-all:3.2.5")
|
implementation("org.videolan.android:libvlc-all:3.3.2")
|
||||||
|
|
||||||
// Image utility
|
// Image utility
|
||||||
implementation("com.squareup.picasso:picasso:2.3.2")
|
implementation("com.squareup.picasso:picasso:2.3.2")
|
||||||
|
@ -0,0 +1,14 @@
|
|||||||
|
package org.jellyfin.androidtv.ui.shared
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.view.View
|
||||||
|
import android.view.inputmethod.InputMethodManager
|
||||||
|
|
||||||
|
class KeyboardFocusChangeListener : View.OnFocusChangeListener {
|
||||||
|
override fun onFocusChange(v : View, hasFocus : Boolean) {
|
||||||
|
(v.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager).apply {
|
||||||
|
if (!hasFocus) hideSoftInputFromWindow(v.windowToken, 0)
|
||||||
|
else showSoftInput(v, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -227,8 +227,14 @@ public class MediaManager {
|
|||||||
mLibVLC = new LibVLC(TvApp.getApplication(), options);
|
mLibVLC = new LibVLC(TvApp.getApplication(), options);
|
||||||
|
|
||||||
mVlcPlayer = new org.videolan.libvlc.MediaPlayer(mLibVLC);
|
mVlcPlayer = new org.videolan.libvlc.MediaPlayer(mLibVLC);
|
||||||
mVlcPlayer.setAudioOutput(Utils.downMixAudio() ? "opensles_android" : "android_audiotrack");
|
if(!Utils.downMixAudio()) {
|
||||||
mVlcPlayer.setAudioOutputDevice("hdmi");
|
mVlcPlayer.setAudioOutput("android_audiotrack");
|
||||||
|
mVlcPlayer.setAudioDigitalOutputEnabled(true);
|
||||||
|
} else {
|
||||||
|
mVlcPlayer.setAudioOutput("opensles_android");
|
||||||
|
mVlcPlayer.setAudioOutputDevice("hdmi");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
mVlcHandler.setOnProgressListener(new PlaybackListener() {
|
mVlcHandler.setOnProgressListener(new PlaybackListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,9 +31,9 @@ import org.jellyfin.androidtv.util.Utils;
|
|||||||
import org.jellyfin.apiclient.model.dto.MediaSourceInfo;
|
import org.jellyfin.apiclient.model.dto.MediaSourceInfo;
|
||||||
import org.jellyfin.apiclient.model.entities.MediaStream;
|
import org.jellyfin.apiclient.model.entities.MediaStream;
|
||||||
import org.jellyfin.apiclient.model.entities.MediaStreamType;
|
import org.jellyfin.apiclient.model.entities.MediaStreamType;
|
||||||
import org.videolan.libvlc.IVLCVout;
|
|
||||||
import org.videolan.libvlc.LibVLC;
|
import org.videolan.libvlc.LibVLC;
|
||||||
import org.videolan.libvlc.Media;
|
import org.videolan.libvlc.Media;
|
||||||
|
import org.videolan.libvlc.interfaces.IVLCVout;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -105,6 +105,7 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
|||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
|
|
||||||
|
|
||||||
mExoPlayerView = view.findViewById(R.id.exoPlayerView);
|
mExoPlayerView = view.findViewById(R.id.exoPlayerView);
|
||||||
mExoPlayerView.setPlayer(mExoPlayer);
|
mExoPlayerView.setPlayer(mExoPlayer);
|
||||||
mExoPlayer.addListener(new Player.EventListener() {
|
mExoPlayer.addListener(new Player.EventListener() {
|
||||||
@ -437,16 +438,25 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
|||||||
public long getAudioDelay() { return mVlcPlayer != null ? mVlcPlayer.getAudioDelay() / 1000 : 0;}
|
public long getAudioDelay() { return mVlcPlayer != null ? mVlcPlayer.getAudioDelay() / 1000 : 0;}
|
||||||
|
|
||||||
public void setCompatibleAudio() {
|
public void setCompatibleAudio() {
|
||||||
if (!nativeMode) {
|
if (!nativeMode) {
|
||||||
mVlcPlayer.setAudioOutput("opensles_android");
|
mVlcPlayer.setAudioOutput("opensles_android");
|
||||||
mVlcPlayer.setAudioOutputDevice("hdmi");
|
mVlcPlayer.setAudioOutputDevice("hdmi");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAudioMode() {
|
public void setAudioMode() {
|
||||||
if (!nativeMode) {
|
if (!nativeMode) {
|
||||||
mVlcPlayer.setAudioOutput(Utils.downMixAudio() ? "opensles_android" : "android_audiotrack");
|
setVlcAudioOptions();
|
||||||
mVlcPlayer.setAudioOutputDevice("hdmi");
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setVlcAudioOptions() {
|
||||||
|
|
||||||
|
if(!Utils.downMixAudio()) {
|
||||||
|
mVlcPlayer.setAudioOutput("android_audiotrack");
|
||||||
|
mVlcPlayer.setAudioDigitalOutputEnabled(true);
|
||||||
|
} else {
|
||||||
|
setCompatibleAudio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,8 +512,7 @@ public class VideoManager implements IVLCVout.OnNewVideoLayoutListener {
|
|||||||
TvApp.getApplication().getLogger().Info("Network buffer set to %d", buffer);
|
TvApp.getApplication().getLogger().Info("Network buffer set to %d", buffer);
|
||||||
|
|
||||||
mVlcPlayer = new org.videolan.libvlc.MediaPlayer(mLibVLC);
|
mVlcPlayer = new org.videolan.libvlc.MediaPlayer(mLibVLC);
|
||||||
mVlcPlayer.setAudioOutput(Utils.downMixAudio() ? "opensles_android" : "android_audiotrack");
|
setVlcAudioOptions();
|
||||||
mVlcPlayer.setAudioOutputDevice("hdmi");
|
|
||||||
|
|
||||||
|
|
||||||
mSurfaceHolder.addCallback(mSurfaceCallback);
|
mSurfaceHolder.addCallback(mSurfaceCallback);
|
||||||
|
@ -45,6 +45,9 @@ public class ImageUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item.getBaseItemType() == BaseItemType.UserView && item.getHasPrimaryImage())
|
||||||
|
return ImageUtils.ASPECT_RATIO_16_9;
|
||||||
|
|
||||||
return item.getPrimaryImageAspectRatio() != null ? item.getPrimaryImageAspectRatio() : ASPECT_RATIO_7_9;
|
return item.getPrimaryImageAspectRatio() != null ? item.getPrimaryImageAspectRatio() : ASPECT_RATIO_7_9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,7 +172,6 @@ public class ProfileHelper {
|
|||||||
ContainerTypes.OGM,
|
ContainerTypes.OGM,
|
||||||
ContainerTypes.OGV,
|
ContainerTypes.OGV,
|
||||||
ContainerTypes.M2V,
|
ContainerTypes.M2V,
|
||||||
ContainerTypes.AVI,
|
|
||||||
ContainerTypes.MPG,
|
ContainerTypes.MPG,
|
||||||
ContainerTypes.MPEG,
|
ContainerTypes.MPEG,
|
||||||
ContainerTypes.MP4,
|
ContainerTypes.MP4,
|
||||||
@ -236,33 +235,24 @@ public class ProfileHelper {
|
|||||||
new ProfileCondition(ProfileConditionType.GreaterThanEqual, ProfileConditionValue.RefFrames, "2"),
|
new ProfileCondition(ProfileConditionType.GreaterThanEqual, ProfileConditionValue.RefFrames, "2"),
|
||||||
});
|
});
|
||||||
|
|
||||||
ContainerProfile videoContainerProfile = new ContainerProfile();
|
|
||||||
videoContainerProfile.setType(DlnaProfileType.Video);
|
|
||||||
videoContainerProfile.setContainer(ContainerTypes.AVI);
|
|
||||||
videoContainerProfile.setConditions(new ProfileCondition[]
|
|
||||||
{
|
|
||||||
new ProfileCondition(ProfileConditionType.NotEquals, ProfileConditionValue.VideoCodecTag, "xvid"),
|
|
||||||
});
|
|
||||||
|
|
||||||
CodecProfile videoAudioCodecProfile = new CodecProfile();
|
CodecProfile videoAudioCodecProfile = new CodecProfile();
|
||||||
videoAudioCodecProfile.setType(CodecType.VideoAudio);
|
videoAudioCodecProfile.setType(CodecType.VideoAudio);
|
||||||
videoAudioCodecProfile.setConditions(new ProfileCondition[]{new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "6")});
|
videoAudioCodecProfile.setConditions(new ProfileCondition[]{new ProfileCondition(ProfileConditionType.LessThanEqual, ProfileConditionValue.AudioChannels, "8")});
|
||||||
|
|
||||||
profile.setCodecProfiles(new CodecProfile[]{getHevcProfile(), h264MainProfile, videoAudioCodecProfile});
|
profile.setCodecProfiles(new CodecProfile[]{getHevcProfile(), h264MainProfile, videoAudioCodecProfile});
|
||||||
profile.setContainerProfiles(new ContainerProfile[] {videoContainerProfile});
|
|
||||||
profile.setSubtitleProfiles(new SubtitleProfile[]{
|
profile.setSubtitleProfiles(new SubtitleProfile[]{
|
||||||
getSubtitleProfile("srt", SubtitleDeliveryMethod.External),
|
getSubtitleProfile("srt", SubtitleDeliveryMethod.External),
|
||||||
getSubtitleProfile("srt", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("srt", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("subrip", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("subrip", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("ass", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("ass", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("ssa", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("ssa", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("pgs", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("pgs", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("pgssub", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("pgssub", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("dvdsub", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("dvdsub", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("vtt", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("vtt", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("sub", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("sub", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("smi", SubtitleDeliveryMethod.Embed),
|
getSubtitleProfile("smi", SubtitleDeliveryMethod.Embed),
|
||||||
getSubtitleProfile("idx", SubtitleDeliveryMethod.Embed)
|
getSubtitleProfile("idx", SubtitleDeliveryMethod.Embed)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ import org.jellyfin.androidtv.model.LogonCredentials;
|
|||||||
import org.jellyfin.androidtv.startup.SelectServerActivity;
|
import org.jellyfin.androidtv.startup.SelectServerActivity;
|
||||||
import org.jellyfin.androidtv.startup.SelectUserActivity;
|
import org.jellyfin.androidtv.startup.SelectUserActivity;
|
||||||
import org.jellyfin.androidtv.util.DelayedMessage;
|
import org.jellyfin.androidtv.util.DelayedMessage;
|
||||||
|
import org.jellyfin.androidtv.ui.shared.KeyboardFocusChangeListener;
|
||||||
import org.jellyfin.androidtv.util.Utils;
|
import org.jellyfin.androidtv.util.Utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -39,6 +40,7 @@ public class AuthenticationHelper {
|
|||||||
final EditText address = new EditText(activity);
|
final EditText address = new EditText(activity);
|
||||||
address.setHint(activity.getString(R.string.lbl_ip_hint));
|
address.setHint(activity.getString(R.string.lbl_ip_hint));
|
||||||
address.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
|
address.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_URI);
|
||||||
|
address.setOnFocusChangeListener(new KeyboardFocusChangeListener());
|
||||||
new AlertDialog.Builder(activity)
|
new AlertDialog.Builder(activity)
|
||||||
.setTitle(activity.getString(R.string.lbl_enter_server_address))
|
.setTitle(activity.getString(R.string.lbl_enter_server_address))
|
||||||
.setMessage(activity.getString(R.string.lbl_valid_server_address))
|
.setMessage(activity.getString(R.string.lbl_valid_server_address))
|
||||||
@ -61,6 +63,7 @@ public class AuthenticationHelper {
|
|||||||
public static void enterManualUser(final Activity activity) {
|
public static void enterManualUser(final Activity activity) {
|
||||||
final EditText userName = new EditText(activity);
|
final EditText userName = new EditText(activity);
|
||||||
userName.setInputType(InputType.TYPE_CLASS_TEXT);
|
userName.setInputType(InputType.TYPE_CLASS_TEXT);
|
||||||
|
userName.setOnFocusChangeListener(new KeyboardFocusChangeListener());
|
||||||
new AlertDialog.Builder(activity)
|
new AlertDialog.Builder(activity)
|
||||||
.setTitle(activity.getString(R.string.lbl_enter_user_name))
|
.setTitle(activity.getString(R.string.lbl_enter_user_name))
|
||||||
.setView(userName)
|
.setView(userName)
|
||||||
@ -74,6 +77,7 @@ public class AuthenticationHelper {
|
|||||||
TvApp.getApplication().getLogger().Debug("Entered user: %s", userValue);
|
TvApp.getApplication().getLogger().Debug("Entered user: %s", userValue);
|
||||||
final EditText userPw = new EditText(activity);
|
final EditText userPw = new EditText(activity);
|
||||||
userPw.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
userPw.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
|
||||||
|
userPw.setOnFocusChangeListener(new KeyboardFocusChangeListener());
|
||||||
new AlertDialog.Builder(activity)
|
new AlertDialog.Builder(activity)
|
||||||
.setTitle(activity.getString(R.string.lbl_enter_user_pw))
|
.setTitle(activity.getString(R.string.lbl_enter_user_pw))
|
||||||
.setView(userPw)
|
.setView(userPw)
|
||||||
|
Reference in New Issue
Block a user