Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2017-03-21 09:44:34 +01:00
commit 2473069326
3 changed files with 24 additions and 3 deletions

View file

@ -138,6 +138,7 @@
<data android:host="www.youtube.com" />
<!-- video prefix -->
<data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch" />
<data android:pathPrefix="/attribution_link" />
<!-- channel prefix -->
@ -195,6 +196,7 @@
<data android:host="www.youtube.com" />
<!-- video prefix -->
<data android:pathPrefix="/v/" />
<data android:pathPrefix="/embed/" />
<data android:pathPrefix="/watch" />
<data android:pathPrefix="/attribution_link" />
<!-- channel prefix -->

View file

@ -147,6 +147,7 @@ public class ChannelActivity extends AppCompatActivity {
serviceId = savedInstanceState.getInt(NavStack.SERVICE_ID);
NavStack.getInstance()
.restoreSavedInstanceState(savedInstanceState);
handleIntent(getIntent());
}
}

View file

@ -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;
@ -818,8 +820,24 @@ 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) {
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();
}
}
}