Skip to content

Commit

Permalink
remove timestamp from share url for all services except youtube
Browse files Browse the repository at this point in the history
It produces not found error for PeerTube, media.ccc.de, SoundCloud
  • Loading branch information
B0pol committed Dec 19, 2020
1 parent 2880280 commit 9436828
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -889,10 +889,15 @@ private void onMoreOptionsClicked() {
private void onShareClicked() {
// share video at the current time (youtube.com/watch?v=ID&t=SECONDS)
// Timestamp doesn't make sense in a live stream so drop it
final String ts = isLive() ? "" : ("&t=" + (getPlaybackSeekBar().getProgress() / 1000));

String videoUrl = getVideoUrl();
final int ts = getPlaybackSeekBar().getProgress() / 1000;
if (!isLive() && videoUrl.contains("https://www.youtube.com") && ts >= 0) {
videoUrl += ("&t=" + ts);
}
ShareUtils.shareUrl(service,
getVideoTitle(),
getVideoUrl() + ts);
videoUrl);
}

private void onPlayWithKodiClicked() {
Expand Down

0 comments on commit 9436828

Please sign in to comment.