Commit 22d39391 authored by Thomas's avatar Thomas
Browse files

Fix Peertube videos

parent c9516e77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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"
+5 −0
Original line number Diff line number Diff line
[
  {
    "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",
+15 −0
Original line number Diff line number Diff line
@@ -117,6 +117,21 @@ public class PeertubeVideo implements Serializable {
        public List<File> files;
        @SerializedName("views")
        public int views;
        @SerializedName("streamingPlaylists")
        public List<StreamingPlaylist> 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<File> files;
    }

    public class File implements Serializable {
+1 −1
Original line number Diff line number Diff line
@@ -1119,7 +1119,7 @@ public class StatusAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>
                    // 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);
+2 −0
Original line number Diff line number Diff line
@@ -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 {