mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-04 16:00:30 +01:00
fixed autoplay bug
This commit is contained in:
parent
751ffb9de9
commit
fc8160acda
app/src/main/java/org/schabi/newpipe
@ -130,7 +130,7 @@ public class PlayVideoActivity extends AppCompatActivity {
|
||||
public void onPrepared(MediaPlayer mp) {
|
||||
progressBar.setVisibility(View.GONE);
|
||||
videoView.seekTo(position);
|
||||
if (position == 0) {
|
||||
if (position <= 0) {
|
||||
videoView.start();
|
||||
showUi();
|
||||
} else {
|
||||
|
@ -111,7 +111,7 @@ public class VideoInfo extends AbstractVideoInfo {
|
||||
public VideoPreviewInfo next_video = null;
|
||||
public List<VideoPreviewInfo> related_videos = null;
|
||||
//in seconds. some metadata is not passed using a VideoInfo object!
|
||||
public int start_position = -1;
|
||||
public int start_position = 0;
|
||||
//todo: public int service_id = -1;
|
||||
|
||||
public VideoInfo() {}
|
||||
|
@ -463,7 +463,6 @@ public class YoutubeStreamExtractor implements StreamExtractor {
|
||||
* @return the offset (in seconds), or 0 if no timestamp is found.*/
|
||||
@Override
|
||||
public int getTimeStamp() throws ParsingException {
|
||||
//todo: use video_info for getting timestamp
|
||||
String timeStamp;
|
||||
try {
|
||||
timeStamp = Parser.matchGroup1("((#|&|\\?)t=\\d{0,3}h?\\d{0,3}m?\\d{1,3}s?)", pageUrl);
|
||||
@ -505,7 +504,7 @@ public class YoutubeStreamExtractor implements StreamExtractor {
|
||||
throw new ParsingException("Could not get timestamp.", e);
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user