diff --git a/app/build.gradle b/app/build.gradle index 19590684a..e591ddf82 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { defaultConfig { minSdk 21 targetSdk 31 - versionCode 402 - versionName "3.1.0" + versionCode 403 + versionName "3.1.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } flavorDimensions "default" diff --git a/app/src/main/assets/release_notes/notes.json b/app/src/main/assets/release_notes/notes.json index 13358d3ca..b951e4b93 100644 --- a/app/src/main/assets/release_notes/notes.json +++ b/app/src/main/assets/release_notes/notes.json @@ -1,4 +1,9 @@ [ + { + "version": "3.1.1", + "code": "403", + "note": "Added:\n- Export Settings\n\nFixed:\n- Respect the default visibility account when replying\n- Discriminate gif from images\n- App crashes when opening external instance timeline\n- Remove button in thread composer crashes the app\n- Back button opens a lot of old activities before closing the app\n- Problems with sharing" + }, { "version": "3.1.0", "code": "402", diff --git a/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java b/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java index 7f48a99a3..c4751affd 100644 --- a/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java +++ b/app/src/main/java/app/fedilab/android/client/entities/peertube/PeertubeVideo.java @@ -117,6 +117,21 @@ public class PeertubeVideo implements Serializable { public List files; @SerializedName("views") public int views; + @SerializedName("streamingPlaylists") + public List streamingPlaylists; + } + + public class StreamingPlaylist implements Serializable { + @SerializedName("id") + public String id; + @SerializedName("type") + public int type; + @SerializedName("playlistUrl") + public String playlistUrl; + @SerializedName("segmentsSha256Url") + public String segmentsSha256Url; + @SerializedName("files") + public List files; } public class File implements Serializable { diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index 1a5bd581f..c00c406e0 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -1119,7 +1119,7 @@ public class StatusAdapter extends RecyclerView.Adapter // start the new activity context.startActivity(mediaIntent, options.toBundle()); }); - if (statusToDeal.media_attachments.get(0).type != null && statusToDeal.media_attachments.get(0).type.equalsIgnoreCase("video")) { + if (statusToDeal.media_attachments.get(0).type != null && (statusToDeal.media_attachments.get(0).type.equalsIgnoreCase("video") || statusToDeal.media_attachments.get(0).type.equalsIgnoreCase("gifv"))) { layoutMediaBinding.playVideo.setVisibility(View.VISIBLE); } else { layoutMediaBinding.playVideo.setVisibility(View.GONE); diff --git a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java index 056c08e06..5632de8d7 100644 --- a/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java +++ b/app/src/main/java/app/fedilab/android/ui/fragment/media/FragmentMedia.java @@ -210,6 +210,8 @@ public class FragmentMedia extends Fragment { timelinesVM.getPeertubeVideo(attachment.peertubeHost, attachment.peertubeId).observe(requireActivity(), video -> { if (video != null && video.files != null && video.files.size() > 0) { loadVideo(video.files.get(0).fileUrl, finalType); + } else if (video != null && video.streamingPlaylists != null && video.streamingPlaylists.size() > 0 && video.streamingPlaylists.get(0).files.size() > 0) { + loadVideo(video.streamingPlaylists.get(0).files.get(0).fileUrl, finalType); } }); } else {