some changes with resolution
This commit is contained in:
parent
979739cc21
commit
f082611b02
|
@ -611,7 +611,7 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||||
}
|
}
|
||||||
captions = null;
|
captions = null;
|
||||||
}
|
}
|
||||||
currentResolution = null;
|
currentResolution = getString(R.string.auto);
|
||||||
show_more_content = null;
|
show_more_content = null;
|
||||||
currentCaption = "null";
|
currentCaption = "null";
|
||||||
binding.peertubeDescriptionMore.setVisibility(View.GONE);
|
binding.peertubeDescriptionMore.setVisibility(View.GONE);
|
||||||
|
@ -1767,8 +1767,18 @@ public class PeertubeActivity extends BasePeertubeActivity implements CommentLis
|
||||||
case RESOLUTION:
|
case RESOLUTION:
|
||||||
binding.subMenuTitle.setText(R.string.pickup_resolution);
|
binding.subMenuTitle.setText(R.string.pickup_resolution);
|
||||||
int position = 0;
|
int position = 0;
|
||||||
for (File file : peertube.getFiles()) {
|
for (File file : peertube.getAllFile(PeertubeActivity.this)) {
|
||||||
if (file.getResolutions() != null) {
|
|
||||||
|
if (file.getResolutions() == null) {
|
||||||
|
MenuItemView item = new MenuItemView();
|
||||||
|
item.setId(0);
|
||||||
|
item.setLabel(file.getResolutions().getLabel());
|
||||||
|
if (file.getResolutions().getLabel().compareTo(currentResolution) == 0) {
|
||||||
|
item.setSelected(true);
|
||||||
|
}
|
||||||
|
items.add(item);
|
||||||
|
position++;
|
||||||
|
} else if (file.getResolutions() != null) {
|
||||||
if (file.getResolutions().getLabel().compareTo("0p") != 0) {
|
if (file.getResolutions().getLabel().compareTo("0p") != 0) {
|
||||||
MenuItemView item = new MenuItemView();
|
MenuItemView item = new MenuItemView();
|
||||||
item.setId(position);
|
item.setId(position);
|
||||||
|
|
|
@ -27,6 +27,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import app.fedilab.android.R;
|
||||||
import app.fedilab.android.peertube.client.entities.File;
|
import app.fedilab.android.peertube.client.entities.File;
|
||||||
import app.fedilab.android.peertube.client.entities.Item;
|
import app.fedilab.android.peertube.client.entities.Item;
|
||||||
import app.fedilab.android.peertube.client.entities.ItemStr;
|
import app.fedilab.android.peertube.client.entities.ItemStr;
|
||||||
|
@ -150,13 +151,13 @@ public class VideoData implements Serializable {
|
||||||
} else if (streamingPlaylists != null) {
|
} else if (streamingPlaylists != null) {
|
||||||
List<File> files = new ArrayList<>();
|
List<File> files = new ArrayList<>();
|
||||||
for (StreamingPlaylists streamingPlaylists : streamingPlaylists) {
|
for (StreamingPlaylists streamingPlaylists : streamingPlaylists) {
|
||||||
|
File file = new File();
|
||||||
|
file.setResolutions(new Item(0, context.getString(R.string.auto)));
|
||||||
|
file.setFileUrl(streamingPlaylists.getPlaylistUrl());
|
||||||
|
file.setFileDownloadUrl(streamingPlaylists.getPlaylistUrl());
|
||||||
|
files.add(file);
|
||||||
if (streamingPlaylists.getFiles().size() > 0) {
|
if (streamingPlaylists.getFiles().size() > 0) {
|
||||||
files.addAll(streamingPlaylists.getFiles());
|
files.addAll(streamingPlaylists.getFiles());
|
||||||
} else {
|
|
||||||
File file = new File();
|
|
||||||
file.setFileUrl(streamingPlaylists.getPlaylistUrl());
|
|
||||||
file.setFileDownloadUrl(streamingPlaylists.getPlaylistUrl());
|
|
||||||
files.add(file);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return files;
|
return files;
|
||||||
|
|
|
@ -30,6 +30,10 @@ public class Item implements Serializable {
|
||||||
public Item() {
|
public Item() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Item(int id, String label) {
|
||||||
|
this.id = id;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
return id;
|
return id;
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
|
|
||||||
|
|
||||||
|
<string name="auto">Auto</string>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in New Issue