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