From b4ea5926386316abf13a647061759d1823ad41df Mon Sep 17 00:00:00 2001 From: mauriciocolli Date: Fri, 17 Mar 2017 00:27:59 -0300 Subject: [PATCH 1/5] Handle embed links - Fix #480 - Add /embed/ to intent filter, as the app already handles these type of links internally --- app/src/main/AndroidManifest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4e8ca0676..a7dcd9205 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -138,6 +138,7 @@ + @@ -195,6 +196,7 @@ + @@ -238,4 +240,4 @@ - \ No newline at end of file + From c100d15ba8324019b100e537b7c68fba3b427cd9 Mon Sep 17 00:00:00 2001 From: mauriciocolli Date: Fri, 17 Mar 2017 11:50:27 -0300 Subject: [PATCH 2/5] Fix bug when fetching unavailable content - Fix #482 - When opening a invalid/deleted/unavailable video, the popup was just printing the error, now it shows a message to the user and exits --- .../org/schabi/newpipe/player/PopupVideoPlayer.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 7d211ecdb..7d6345a8a 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -819,8 +819,15 @@ public class PopupVideoPlayer extends Service implements StateInterface { } }); } catch (Exception e) { - e.printStackTrace(); + if (DEBUG) e.printStackTrace(); + mainHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(PopupVideoPlayer.this, R.string.content_not_available, Toast.LENGTH_SHORT).show(); + } + }); + stopSelf(); } } } -} \ No newline at end of file +} From e406ba094cf8aa81e9af5c9dfa1187e66c38005f Mon Sep 17 00:00:00 2001 From: mauriciocolli Date: Fri, 17 Mar 2017 12:09:20 -0300 Subject: [PATCH 3/5] Improve bug detection - Show a message with the appropriate error (network error) --- .../java/org/schabi/newpipe/player/PopupVideoPlayer.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 7d6345a8a..95ce2e69c 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -818,6 +818,15 @@ public class PopupVideoPlayer extends Service implements StateInterface { }); } }); + } catch (IOException ie) { + if (DEBUG) ie.printStackTrace(); + mainHandler.post(new Runnable() { + @Override + public void run() { + Toast.makeText(PopupVideoPlayer.this, R.string.network_error, Toast.LENGTH_SHORT).show(); + } + }); + stopSelf(); } catch (Exception e) { if (DEBUG) e.printStackTrace(); mainHandler.post(new Runnable() { From 461f747af14e1acaa9c83dc06e9fd461353a7f74 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Fri, 17 Mar 2017 20:18:44 +0100 Subject: [PATCH 4/5] add IOException --- .../main/java/org/schabi/newpipe/player/PopupVideoPlayer.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java index 95ce2e69c..e396ac1b6 100644 --- a/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/PopupVideoPlayer.java @@ -60,6 +60,8 @@ import org.schabi.newpipe.player.popup.PopupViewHolder; import org.schabi.newpipe.player.popup.StateInterface; import org.schabi.newpipe.util.NavStack; +import java.io.IOException; + public class PopupVideoPlayer extends Service implements StateInterface { private static final String TAG = ".PopupVideoPlayer"; private static final boolean DEBUG = false; From e3baf69533a3df95d72a8d7f3d02292638a1a1aa Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Fri, 17 Mar 2017 20:35:22 +0100 Subject: [PATCH 5/5] fix channel rotation problem --- app/src/main/java/org/schabi/newpipe/ChannelActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/java/org/schabi/newpipe/ChannelActivity.java b/app/src/main/java/org/schabi/newpipe/ChannelActivity.java index 37ef28a13..6258de152 100644 --- a/app/src/main/java/org/schabi/newpipe/ChannelActivity.java +++ b/app/src/main/java/org/schabi/newpipe/ChannelActivity.java @@ -147,6 +147,7 @@ public class ChannelActivity extends AppCompatActivity { serviceId = savedInstanceState.getInt(NavStack.SERVICE_ID); NavStack.getInstance() .restoreSavedInstanceState(savedInstanceState); + handleIntent(getIntent()); } }