Merge branch 'feature-background-progress' of git://github.com/coffeemakr/NewPipe into coffeemakr-feature-background-progress

This commit is contained in:
Christian Schabesberger 2016-12-28 10:46:38 +01:00
commit a5589d0865
6 changed files with 341 additions and 101 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
/.idea
/*.iml
gradle.properties
*~

View File

@ -31,14 +31,14 @@ public class AudioStream {
this.bandwidth = bandwidth; this.sampling_rate = samplingRate;
}
// reveals wether two streams are the same, but have diferent urls
// reveals whether two streams are the same, but have different urls
public boolean equalStats(AudioStream cmp) {
return format == cmp.format
&& bandwidth == cmp.bandwidth
&& sampling_rate == cmp.sampling_rate;
}
// revelas wether two streams are equal
// reveals whether two streams are equal
public boolean equals(AudioStream cmp) {
return cmp != null && equalStats(cmp)
&& url == cmp.url;

View File

@ -37,14 +37,14 @@ public abstract class StreamExtractor {
private UrlIdHandler urlIdHandler;
private StreamPreviewInfoCollector previewInfoCollector;
public class ExctractorInitException extends ExtractionException {
public ExctractorInitException(String message) {
public class ExtractorInitException extends ExtractionException {
public ExtractorInitException(String message) {
super(message);
}
public ExctractorInitException(Throwable cause) {
public ExtractorInitException(Throwable cause) {
super(cause);
}
public ExctractorInitException(String message, Throwable cause) {
public ExtractorInitException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -86,8 +86,8 @@ public class StreamInfo extends AbstractStreamInfo {
private static StreamInfo extractImportantData(
StreamInfo streamInfo, StreamExtractor extractor)
throws ExtractionException, IOException {
/* ---- importand data, withoug the video can't be displayed goes here: ---- */
// if one of these is not available an exception is ment to be thrown directly into the frontend.
/* ---- important data, withoug the video can't be displayed goes here: ---- */
// if one of these is not available an exception is meant to be thrown directly into the frontend.
UrlIdHandler uiconv = extractor.getUrlIdHandler();
@ -134,7 +134,7 @@ public class StreamInfo extends AbstractStreamInfo {
streamInfo.audio_streams = new Vector<>();
}
//todo: make this quick and dirty solution a real fallback
// same as the quick and dirty aboth
// same as the quick and dirty above
try {
streamInfo.audio_streams.addAll(
DashMpdParser.getAudioStreams(streamInfo.dashMpdUrl));
@ -173,9 +173,9 @@ public class StreamInfo extends AbstractStreamInfo {
private static StreamInfo extractOptionalData(
StreamInfo streamInfo, StreamExtractor extractor) {
/* ---- optional data goes here: ---- */
// If one of these failes, the frontend neets to handle that they are not available.
// Exceptions are therfore not thrown into the frontend, but stored into the error List,
// so the frontend can afterwads check where errors happend.
// If one of these fails, the frontend needs to handle that they are not available.
// Exceptions are therefore not thrown into the frontend, but stored into the error List,
// so the frontend can afterwards check where errors happened.
try {
streamInfo.thumbnail_url = extractor.getThumbnailUrl();
@ -290,4 +290,4 @@ public class StreamInfo extends AbstractStreamInfo {
public int start_position = 0;
public List<Throwable> errors = new Vector<>();
}
}

View File

@ -20,7 +20,7 @@
android:layout_above="@+id/notificationButtons"
android:layout_toRightOf="@+id/notificationCover"
android:gravity="center_vertical"
android:orientation="vertical" >
android:orientation="vertical">
<TextView
android:id="@+id/notificationSongName"
@ -40,6 +40,13 @@
android:ellipsize="marquee"
android:singleLine="true"
android:text="artist" />
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/playbackProgress"
style="@style/Widget.AppCompat.ProgressBar.Horizontal"
android:layout_marginRight="8dp" />
</LinearLayout>
<ImageButton