Change peertube video host
This commit is contained in:
parent
ad950dfe5f
commit
02bddbe012
|
@ -559,7 +559,7 @@ public class API {
|
||||||
List<HowToVideo> howToVideos = new ArrayList<>();
|
List<HowToVideo> howToVideos = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
HttpsConnection httpsConnection = new HttpsConnection(context);
|
HttpsConnection httpsConnection = new HttpsConnection(context);
|
||||||
String response = httpsConnection.get("https://peertube.fr/api/v1/video-channels/bb32394a-a6d2-4f41-9b8e-ad9514a66009/videos", 60, null, null);
|
String response = httpsConnection.get("https://peertube.social/api/v1/video-channels/mastalab_channel/videos", 60, null, null);
|
||||||
JSONArray jsonArray = new JSONObject(response).getJSONArray("data");
|
JSONArray jsonArray = new JSONObject(response).getJSONArray("data");
|
||||||
howToVideos = parseHowTos(jsonArray);
|
howToVideos = parseHowTos(jsonArray);
|
||||||
} catch (HttpsConnection.HttpsConnectionException e) {
|
} catch (HttpsConnection.HttpsConnectionException e) {
|
||||||
|
|
|
@ -118,14 +118,14 @@ public class HowToVideosAdapter extends BaseAdapter implements OnListActionInter
|
||||||
next.setBounds(0,0,(int) (30 * scale + 0.5f),(int) (30 * scale + 0.5f));
|
next.setBounds(0,0,(int) (30 * scale + 0.5f),(int) (30 * scale + 0.5f));
|
||||||
holder.how_to_description.setCompoundDrawables(null, null, next, null);
|
holder.how_to_description.setCompoundDrawables(null, null, next, null);
|
||||||
Glide.with(holder.how_to_image.getContext())
|
Glide.with(holder.how_to_image.getContext())
|
||||||
.load("https://peertube.fr" + howToVideo.getThumbnailPath())
|
.load("https://peertube.social" + howToVideo.getThumbnailPath())
|
||||||
.into(holder.how_to_image);
|
.into(holder.how_to_image);
|
||||||
holder.how_to_container.setOnClickListener(new View.OnClickListener() {
|
holder.how_to_container.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
Intent intent = new Intent(context, WebviewActivity.class);
|
Intent intent = new Intent(context, WebviewActivity.class);
|
||||||
Bundle b = new Bundle();
|
Bundle b = new Bundle();
|
||||||
String finalUrl = "https://peertube.fr" + howToVideo.getEmbedPath();
|
String finalUrl = "https://peertube.social" + howToVideo.getEmbedPath();
|
||||||
b.putString("url", finalUrl);
|
b.putString("url", finalUrl);
|
||||||
b.putBoolean("peertubeLink", true);
|
b.putBoolean("peertubeLink", true);
|
||||||
Pattern link = Pattern.compile("(https?:\\/\\/[\\da-z\\.-]+\\.[a-z\\.]{2,10})\\/videos\\/embed\\/(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12})$");
|
Pattern link = Pattern.compile("(https?:\\/\\/[\\da-z\\.-]+\\.[a-z\\.]{2,10})\\/videos\\/embed\\/(\\w{8}-\\w{4}-\\w{4}-\\w{4}-\\w{12})$");
|
||||||
|
|
Loading…
Reference in New Issue