Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code changes to enable player thumbnail seekbar preview in NewPipe #647

Merged
merged 8 commits into from
Jul 17, 2021

Conversation

litetex
Copy link
Member

@litetex litetex commented Jun 5, 2021

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

This pr is required for fixing TeamNewPipe/NewPipe#3207
This is the nested/required PR for TeamNewPipe/NewPipe#6434

Also fixes: #595

Changes

  • Exposed the thumbnail preview frames

@litetex litetex changed the title Code changes to enable player seekbar preview in NewPipe Code changes to enable player thumbnail seekbar preview in NewPipe Jun 5, 2021
@litetex litetex marked this pull request as ready for review June 5, 2021 22:53
Copy link
Contributor

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one small thing.

Note for whoever this is merging: please squash

@litetex
Copy link
Member Author

litetex commented Jun 8, 2021

Wait a moment, when a very short video is played (e.g. https://www.youtube.com/watch?v=jhFDyDgMVUI) then the extractor fails:

-------------------------------------
org.schabi.newpipe.extractor.exceptions.ExtractionException: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
	at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.getFrames(YoutubeStreamExtractor.java:1099)
	at org.schabi.newpipe.extractor.stream.StreamInfo.extractOptionalData(StreamInfo.java:339)
	at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:73)
	at org.schabi.newpipe.extractor.stream.StreamInfo.getInfo(StreamInfo.java:64)
	at org.schabi.newpipe.util.ExtractorHelper.lambda$getStreamInfo$3(ExtractorHelper.java:115)
	at org.schabi.newpipe.util.-$$Lambda$ExtractorHelper$YTHJjScxCJNO1LTCqs3IKy35iyY.call(Unknown Source:4)
	at io.reactivex.rxjava3.internal.operators.single.SingleFromCallable.subscribeActual(SingleFromCallable.java:43)
	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
	at io.reactivex.rxjava3.internal.operators.single.SingleDoOnSuccess.subscribeActual(SingleDoOnSuccess.java:35)
	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
	at io.reactivex.rxjava3.internal.operators.maybe.MaybeFromSingle.subscribeActual(MaybeFromSingle.java:41)
	at io.reactivex.rxjava3.core.Maybe.subscribe(Maybe.java:5330)
	at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.drain(MaybeConcatArray.java:153)
	at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray$ConcatMaybeObserver.request(MaybeConcatArray.java:78)
	at io.reactivex.rxjava3.internal.operators.flowable.FlowableElementAtMaybe$ElementAtSubscriber.onSubscribe(FlowableElementAtMaybe.java:66)
	at io.reactivex.rxjava3.internal.operators.maybe.MaybeConcatArray.subscribeActual(MaybeConcatArray.java:42)
	at io.reactivex.rxjava3.core.Flowable.subscribe(Flowable.java:15753)
	at io.reactivex.rxjava3.internal.operators.flowable.FlowableElementAtMaybe.subscribeActual(FlowableElementAtMaybe.java:36)
	at io.reactivex.rxjava3.core.Maybe.subscribe(Maybe.java:5330)
	at io.reactivex.rxjava3.internal.operators.maybe.MaybeToSingle.subscribeActual(MaybeToSingle.java:46)
	at io.reactivex.rxjava3.core.Single.subscribe(Single.java:4813)
	at io.reactivex.rxjava3.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run(SingleSubscribeOn.java:89)
	at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:614)
	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
	at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:923)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
	at org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor.getFrames(YoutubeStreamExtractor.java:1061)
	... 29 more
-------------------------------------

@litetex litetex force-pushed the playerSeekbarPreview branch from 0bcb4d7 to d8672a4 Compare June 8, 2021 19:11
@TobiGr
Copy link
Contributor

TobiGr commented Jun 8, 2021

Something simple like TobiGr/NewPipeExtractor@e831c0e should solve that

@litetex
Copy link
Member Author

litetex commented Jun 9, 2021

@TobiGr
Was already fixed with fb7228a

@Stypox
Copy link
Member

Stypox commented Jun 13, 2021

@litetex were you able to find out the problem?

@litetex
Copy link
Member Author

litetex commented Jun 13, 2021

@Stypox

@litetex were you able to find out the problem?

Yes, as stated above, it was already fixed with fb7228a 😄

@TobiGr
Copy link
Contributor

TobiGr commented Jun 14, 2021

Please replace new ArrayList<>() with Collection.emptyList().

@litetex litetex marked this pull request as draft June 14, 2021 19:43
@litetex litetex force-pushed the playerSeekbarPreview branch from d8672a4 to eb0a74b Compare June 15, 2021 17:40
@litetex litetex marked this pull request as ready for review June 15, 2021 19:58
@litetex
Copy link
Member Author

litetex commented Jun 15, 2021

@TobiGr

Please replace new ArrayList<>() with Collection.emptyList().

Done 😄

@litetex litetex force-pushed the playerSeekbarPreview branch 2 times, most recently from af1dede to 90b87b0 Compare June 27, 2021 12:43
@litetex
Copy link
Member Author

litetex commented Jun 27, 2021

Rebased the branch again and applied @Stypox changes.

Any change of getting this merged soon?
Getting tired of rebasing the branch every week 😢

@Stypox
Copy link
Member

Stypox commented Jul 5, 2021

Any change of getting this merged soon?

After 0.21.6 is released I'd merge this right away @TobiGr

@litetex litetex force-pushed the playerSeekbarPreview branch from 90b87b0 to 794111d Compare July 6, 2021 19:05
@TobiGr TobiGr requested a review from Stypox July 13, 2021 21:00
litetex added 5 commits July 17, 2021 16:41
Reformatted code
To fix ``java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference``
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = org.schabi.newpipe.extractor.stream.StreamInfo)
...
Caused by: java.io.NotSerializableException: org.schabi.newpipe.extractor.stream.Frameset
...
@litetex litetex force-pushed the playerSeekbarPreview branch from 794111d to 0c12b39 Compare July 17, 2021 14:41
@TobiGr TobiGr merged commit ada67d1 into TeamNewPipe:dev Jul 17, 2021
@litetex litetex deleted the playerSeekbarPreview branch July 19, 2021 18:39
@litetex litetex restored the playerSeekbarPreview branch July 19, 2021 19:09
@litetex litetex deleted the playerSeekbarPreview branch July 19, 2021 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frames aren't available in StreamInfo
3 participants