diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d11de9f478d..6692f8537d7 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -406,6 +406,14 @@
+
+
+
+
+
+
+
+
finish()); when creating these DialogFragments
diff --git a/app/src/main/java/org/schabi/newpipe/player/seekbarpreview/SeekbarPreviewThumbnailHolder.java b/app/src/main/java/org/schabi/newpipe/player/seekbarpreview/SeekbarPreviewThumbnailHolder.java
index 09c61b8b35a..c7e4cd78141 100644
--- a/app/src/main/java/org/schabi/newpipe/player/seekbarpreview/SeekbarPreviewThumbnailHolder.java
+++ b/app/src/main/java/org/schabi/newpipe/player/seekbarpreview/SeekbarPreviewThumbnailHolder.java
@@ -132,8 +132,17 @@ private void generateDataFrom(final Frameset frameset, final UUID updateRequestI
// Get the bounds where the frame is found
final int[] bounds = frameset.getFrameBoundsAt(currentPosMs);
- generatedDataForUrl.put(currentPosMs,
- createBitmapSupplier(srcBitMap, bounds, frameset));
+ generatedDataForUrl.put(currentPosMs, () -> {
+ // It can happen, that the original bitmap could not be downloaded
+ // In such a case - we don't want a NullPointer - simply return null
+ if (srcBitMap == null) {
+ return null;
+ }
+
+ // Cut out the corresponding bitmap form the "srcBitMap"
+ return Bitmap.createBitmap(srcBitMap, bounds[1], bounds[2],
+ frameset.getFrameWidth(), frameset.getFrameHeight());
+ });
currentPosMs += frameset.getDurationPerFrame();
pos++;
diff --git a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
index c712157b35b..15e4841e78a 100644
--- a/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
+++ b/app/src/main/java/org/schabi/newpipe/util/ServiceHelper.java
@@ -121,6 +121,16 @@ public static int getSelectedServiceId(final Context context) {
.getServiceId();
}
+ public static int getServiceIdByName(final String serviceName) throws IllegalArgumentException {
+ for (final StreamingService s : NewPipe.getServices()) {
+ if (s.getServiceInfo().getName().equalsIgnoreCase(serviceName)) {
+ return s.getServiceId();
+ }
+ }
+ throw new IllegalArgumentException("Invalid service name");
+ }
+
+
@Nullable
public static StreamingService getSelectedService(final Context context) {
final String serviceName = PreferenceManager.getDefaultSharedPreferences(context)