TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
31.13k stars 3.02k forks source link

Refactor how the player is started or changed #7673

Open litetex opened 2 years ago

litetex commented 2 years ago

The player intent handling needs major refactoring as it's currently unmanageable - and when bugs occur unfixable (#7427)

Occasions where the player is changed or started Summarized call hierarchy: ![grafik](https://user-images.githubusercontent.com/40789489/149827742-0d244b1e-6448-4da5-a76f-0dad3c2f6ca5.png) or as plain text: ``` NavigationHelper.getPlayerIntent(Context, Class, PlayQueue, boolean, boolean) (org.schabi.newpipe.util) VideoDetailFragment.openMainPlayer() (org.schabi.newpipe.fragments.detail) VideoDetailFragment.openVideoPlayer(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.openVideoPlayerAutoFullscreen() (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onServiceConnected(Player, MainPlayer, boolean) (org.schabi.newpipe.fragments.detail) PlayerHolder.setListener(PlayerServiceExtendedEventListener) (org.schabi.newpipe.player.helper) PlayerServiceConnection in PlayerHolder.onServiceConnected(ComponentName, IBinder) (org.schabi.newpipe.player.helper) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.startLoading(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.startLoading(boolean, boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onClick(View) (org.schabi.newpipe.fragments.detail) Anonymous in ActionBarDrawerToggle() in ActionBarDrawerToggle.onClick(View) (androidx.appcompat.app) ClickInterceptSpinner.performClick() (com.android.printspooler.widget) SearchView.onSearchClicked() (android.widget) QSFooterImpl.performAccessibilityAction(int, Bundle) (com.android.systemui.qs) Anonymous in onCreateView() in MaterialDatePicker.onClick(View) (com.google.android.material.datepicker) SearchView.onSearchClicked() (androidx.appcompat.widget) Anonymous in onCreateView() in MaterialTimePicker.onClick(View) (com.google.android.material.timepicker) TextActionModeCallback in Editor.onAssistMenuItemClicked(MenuItem) (android.widget) AccessibilityTargetHelper.createEnableDialogContentView(Context, AccessibilityServiceTarget, OnClickListener, OnClickListener)(2 usages) (com.android.internal.accessibility.dialog) KeyButtonView.onTouchEvent(MotionEvent) (com.android.systemui.statusbar.policy) Anonymous in mOnClickListener in FragmentBreadCrumbs.onClick(View) (android.app) View.callOnClick() (android.view) Anonymous in setAction() in Snackbar.onClick(View) (com.google.android.material.snackbar) RequireScrollMixinTest.testCreateOnClickListener()(2 usages) (com.android.setupwizardlib.template) TunerZenModePanel.onClick(View) (com.android.systemui.tuner) Chip.performCloseIconClick() (com.google.android.material.chip) View.performClick() (android.view) Anonymous in createOnClickListener() in RequireScrollMixin.onClick(View) (com.android.setupwizardlib.template) PassThroughClickListener in AutoCompleteTextView.onClick(View) (android.widget) PhotoView.onSingleTapConfirmed(MotionEvent) (com.android.ex.photo.views) Anonymous in onCreateView() in MaterialTimePicker.onClick(View) (com.google.android.material.timepicker) DelayedOnClickListener in SmartReplyView.onClick(View) (com.android.systemui.statusbar.policy) NavigationHelper.openVideoDetailFragment(Context, FragmentManager, int, String, String, PlayQueue, boolean) (org.schabi.newpipe.util) NavigationHelper.playOnMainPlayer(AppCompatActivity, PlayQueue) (org.schabi.newpipe.util) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) MainActivity.handleIntent(Intent) (org.schabi.newpipe) MainActivity.initFragments() (org.schabi.newpipe) MainActivity.onNewIntent(Intent) (org.schabi.newpipe) Anonymous in initListeners() in LocalPlaylistFragment.selected(LocalItem) (org.schabi.newpipe.local.playlist) BaseFragment.onViewCreated(View, Bundle) (org.schabi.newpipe) FeedFragment.initListeners() (org.schabi.newpipe.local.feed) VideoDetailFragment.onActivityResult(int, int, Intent) (org.schabi.newpipe.fragments.detail) Anonymous in attachController() in FragmentManager.onActivityResult(ActivityResult) (androidx.fragment.app) Anonymous in attachController() in FragmentManager.onActivityResult(ActivityResult) (androidx.fragment.app) Anonymous in initListeners() in StatisticsPlaylistFragment.selected(LocalItem) (org.schabi.newpipe.local.history) BaseFragment.onViewCreated(View, Bundle) (org.schabi.newpipe) FeedFragment.initListeners() (org.schabi.newpipe.local.feed) Anonymous in FeedFragment.kt.onItemClick(Item, View) (org.schabi.newpipe.local.feed) BaseListFragment.onStreamSelected(StreamInfoItem) (org.schabi.newpipe.fragments.list) Anonymous in initListeners() in BaseListFragment.selected(StreamInfoItem) (org.schabi.newpipe.fragments.list) VideoDetailFragment.onClick(View) (org.schabi.newpipe.fragments.detail) Anonymous in ActionBarDrawerToggle() in ActionBarDrawerToggle.onClick(View) (androidx.appcompat.app) ClickInterceptSpinner.performClick() (com.android.printspooler.widget) SearchView.onSearchClicked() (android.widget) QSFooterImpl.performAccessibilityAction(int, Bundle) (com.android.systemui.qs) Anonymous in onCreateView() in MaterialDatePicker.onClick(View) (com.google.android.material.datepicker) SearchView.onSearchClicked() (androidx.appcompat.widget) TextActionModeCallback in Editor.onAssistMenuItemClicked(MenuItem) (android.widget) Anonymous in onCreateView() in MaterialTimePicker.onClick(View) (com.google.android.material.timepicker) AccessibilityTargetHelper.createEnableDialogContentView(Context, AccessibilityServiceTarget, OnClickListener, OnClickListener)(2 usages) (com.android.internal.accessibility.dialog) KeyButtonView.onTouchEvent(MotionEvent) (com.android.systemui.statusbar.policy) Anonymous in mOnClickListener in FragmentBreadCrumbs.onClick(View) (android.app) View.callOnClick() (android.view) Anonymous in setAction() in Snackbar.onClick(View) (com.google.android.material.snackbar) RequireScrollMixinTest.testCreateOnClickListener()(2 usages) (com.android.setupwizardlib.template) TunerZenModePanel.onClick(View) (com.android.systemui.tuner) Chip.performCloseIconClick() (com.google.android.material.chip) PassThroughClickListener in AutoCompleteTextView.onClick(View) (android.widget) View.performClick() (android.view) Anonymous in createOnClickListener() in RequireScrollMixin.onClick(View) (com.android.setupwizardlib.template) PhotoView.onSingleTapConfirmed(MotionEvent) (com.android.ex.photo.views) Anonymous in onCreateView() in MaterialTimePicker.onClick(View) (com.google.android.material.timepicker) DelayedOnClickListener in SmartReplyView.onClick(View) (com.android.systemui.statusbar.policy) NavigationHelper.getPlayerEnqueueIntent(Context, Class, PlayQueue) (org.schabi.newpipe.util) NavigationHelper.enqueueOnPlayer(Context, PlayQueue, PlayerType) (org.schabi.newpipe.util) LocalPlaylistFragment.handleResult(List)(2 usages) (org.schabi.newpipe.local.playlist) SearchFragment.handleResult(SearchInfo) (org.schabi.newpipe.fragments.list.search) BaseListInfoFragment.handleResult(I) (org.schabi.newpipe.fragments.list) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) KioskFragment.handleResult(KioskInfo) (org.schabi.newpipe.fragments.list.kiosk) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) RelatedItemsFragment.handleResult(RelatedItemInfo) (org.schabi.newpipe.fragments.list.videos) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) CommentsFragment.handleResult(CommentsInfo) (org.schabi.newpipe.fragments.list.comments) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) ChannelFragment.handleResult(ChannelInfo)(2 usages) (org.schabi.newpipe.fragments.list.channel) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) VideoDetailFragment.openNormalBackgroundPlayer(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.openBackgroundPlayer(boolean) (org.schabi.newpipe.fragments.detail) NavigationHelper.enqueueOnPlayer(Context, PlayQueue) (org.schabi.newpipe.util) StreamDialogEntry.enqueue (org.schabi.newpipe.util) VideoDetailFragment.openPopupPlayer(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onLongClick(View) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onClick(View) (org.schabi.newpipe.fragments.detail) PlaylistFragment.handleResult(PlaylistInfo)(2 usages) (org.schabi.newpipe.fragments.list.playlist) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) NavigationHelper.playOnBackgroundPlayer(Context, PlayQueue, boolean) (org.schabi.newpipe.util) PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) Anonymous in initListeners() in BaseListFragment.held(StreamInfoItem) (org.schabi.newpipe.fragments.list) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) Anonymous in initListeners() in StatisticsPlaylistFragment.held(LocalItem) (org.schabi.newpipe.local.history) FetcherService in RouterActivity.getResultHandler(Choice) (org.schabi.newpipe) FetcherService in RouterActivity.handleChoice(Choice) (org.schabi.newpipe) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.handleResult(SearchInfo) (org.schabi.newpipe.fragments.list.search) BaseListInfoFragment.handleResult(I) (org.schabi.newpipe.fragments.list) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) KioskFragment.handleResult(KioskInfo) (org.schabi.newpipe.fragments.list.kiosk) FeedFragment.onResume() (org.schabi.newpipe.local.feed) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) RelatedItemsFragment.handleResult(RelatedItemInfo) (org.schabi.newpipe.fragments.list.videos) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) CommentsFragment.handleResult(CommentsInfo) (org.schabi.newpipe.fragments.list.comments) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) StreamDialogEntry.start_here_on_background (org.schabi.newpipe.util) BaseListFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list) BaseListFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) [Invalid] PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) [Invalid] PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) SearchFragment.handleResult(SearchInfo) (org.schabi.newpipe.fragments.list.search) BaseListInfoFragment.handleResult(I) (org.schabi.newpipe.fragments.list) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) KioskFragment.handleResult(KioskInfo) (org.schabi.newpipe.fragments.list.kiosk) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) RelatedItemsFragment.handleResult(RelatedItemInfo) (org.schabi.newpipe.fragments.list.videos) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) CommentsFragment.handleResult(CommentsInfo) (org.schabi.newpipe.fragments.list.comments) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) Anonymous in initListeners() in LocalPlaylistFragment.held(LocalItem) (org.schabi.newpipe.local.playlist) PlayQueueActivity.onOptionsItemSelected(MenuItem) (org.schabi.newpipe.player) PreferenceActivity.onOptionsItemSelected(MenuItem) (android.preference) Activity.onMenuItemSelected(int, MenuItem) (android.app) Activity.onOptionsItemSelected(MenuItem) (android.app) NavigatingActivity.onOptionsItemSelected(MenuItem) (leakcanary.internal.navigation) AboutActivity.onOptionsItemSelected(MenuItem) (org.schabi.newpipe.about) VideoDetailFragment.openNormalBackgroundPlayer(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.openBackgroundPlayer(boolean) (org.schabi.newpipe.fragments.detail) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) NotificationUtil.getIntentForNotification(Player) (org.schabi.newpipe.player) NotificationUtil.updateNotification(Player) (org.schabi.newpipe.player) NotificationUtil.createNotificationIfNeededAndUpdate(Player, boolean) (org.schabi.newpipe.player) Player.onPlayQueueEdited() (org.schabi.newpipe.player) Player.onShuffleOrRepeatModeChanged() (org.schabi.newpipe.player) Player.onMetadataChanged(MediaSourceTag) (org.schabi.newpipe.player) Player.onPlaying() (org.schabi.newpipe.player) Player.onBroadcastReceived(Intent) (org.schabi.newpipe.player) Anonymous in initThumbnail() in Player.onBitmapFailed(Exception, Drawable) (org.schabi.newpipe.player) Player.onBuffering() (org.schabi.newpipe.player) Player.onTimelineChanged(Timeline, int) (org.schabi.newpipe.player) Player.onBlocked() (org.schabi.newpipe.player) Anonymous in initThumbnail() in Player.onBitmapLoaded(Bitmap, LoadedFrom) (org.schabi.newpipe.player) Player.onPaused() (org.schabi.newpipe.player) Player.onPausedSeek() (org.schabi.newpipe.player) Player.onCompleted() (org.schabi.newpipe.player) NotificationUtil.createNotificationAndStartForeground(Player, Service) (org.schabi.newpipe.player) MainPlayer.createView() (org.schabi.newpipe.player) MainPlayer.onStartCommand(Intent, int, int) (org.schabi.newpipe.player) NavigationHelper.getPlayerEnqueueNextIntent(Context, Class, PlayQueue) (org.schabi.newpipe.util) NavigationHelper.enqueueNextOnPlayer(Context, PlayQueue) (org.schabi.newpipe.util) StreamDialogEntry.enqueue_next (org.schabi.newpipe.util) PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) Anonymous in initListeners() in BaseListFragment.held(StreamInfoItem) (org.schabi.newpipe.fragments.list) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) Anonymous in initListeners() in LocalPlaylistFragment.held(LocalItem) (org.schabi.newpipe.local.playlist) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) Anonymous in initListeners() in StatisticsPlaylistFragment.held(LocalItem) (org.schabi.newpipe.local.history) BaseListFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list) Anonymous in initListeners() in BaseListFragment.held(StreamInfoItem) (org.schabi.newpipe.fragments.list) [Invalid] NavigationHelper.playOnPopupPlayer(Context, PlayQueue, boolean) (org.schabi.newpipe.util) Player.onFragmentStopped() (org.schabi.newpipe.player) Player.onBroadcastReceived(Intent)(2 usages) (org.schabi.newpipe.player) FetcherService in RouterActivity.getResultHandler(Choice) (org.schabi.newpipe) FetcherService in RouterActivity.handleChoice(Choice) (org.schabi.newpipe) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.handleResult(SearchInfo) (org.schabi.newpipe.fragments.list.search) BaseListInfoFragment.handleResult(I) (org.schabi.newpipe.fragments.list) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) KioskFragment.handleResult(KioskInfo) (org.schabi.newpipe.fragments.list.kiosk) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) FeedFragment.onResume() (org.schabi.newpipe.local.feed) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) RelatedItemsFragment.handleResult(RelatedItemInfo) (org.schabi.newpipe.fragments.list.videos) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) CommentsFragment.handleResult(CommentsInfo) (org.schabi.newpipe.fragments.list.comments) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) SearchFragment.handleResult(SearchInfo) (org.schabi.newpipe.fragments.list.search) BaseListInfoFragment.handleResult(I) (org.schabi.newpipe.fragments.list) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) KioskFragment.handleResult(KioskInfo) (org.schabi.newpipe.fragments.list.kiosk) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) RelatedItemsFragment.handleResult(RelatedItemInfo) (org.schabi.newpipe.fragments.list.videos) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) ChannelFragment.handleResult(ChannelInfo) (org.schabi.newpipe.fragments.list.channel) CommentsFragment.handleResult(CommentsInfo) (org.schabi.newpipe.fragments.list.comments) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) StreamDialogEntry.start_here_on_popup (org.schabi.newpipe.util) BaseListFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list) StatisticsPlaylistFragment.showStreamDialog(StreamStatisticsEntry) (org.schabi.newpipe.local.history) LocalPlaylistFragment.showStreamItemDialog(PlaylistStreamEntry) (org.schabi.newpipe.local.playlist) PlaylistFragment.showStreamDialog(StreamInfoItem) (org.schabi.newpipe.fragments.list.playlist) [Invalid] PlayQueueActivity.onOptionsItemSelected(MenuItem) (org.schabi.newpipe.player) PreferenceActivity.onOptionsItemSelected(MenuItem) (android.preference) Activity.onMenuItemSelected(int, MenuItem) (android.app) Activity.onOptionsItemSelected(MenuItem) (android.app) NavigatingActivity.onOptionsItemSelected(MenuItem) (leakcanary.internal.navigation) AboutActivity.onOptionsItemSelected(MenuItem) (org.schabi.newpipe.about) VideoDetailFragment.openPopupPlayer(boolean) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onLongClick(View) (org.schabi.newpipe.fragments.detail) VideoDetailFragment.onClick(View) (org.schabi.newpipe.fragments.detail) PlaylistFragment.handleResult(PlaylistInfo) (org.schabi.newpipe.fragments.list.playlist) SubscriptionFragment.handleResult(SubscriptionState) (org.schabi.newpipe.local.subscription) VideoDetailFragment.prepareAndHandleInfo(StreamInfo, boolean) (org.schabi.newpipe.fragments.detail) BookmarkFragment.handleResult(List) (org.schabi.newpipe.local.bookmark) StatisticsPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.history) Anonymous in getPlaylistsSubscriber() in BookmarkFragment.onNext(List) (org.schabi.newpipe.local.bookmark) BaseListInfoFragment.doInitialLoadLogic() (org.schabi.newpipe.fragments.list) FeedFragment.onResume() (org.schabi.newpipe.local.feed) Anonymous in getHistoryObserver() in StatisticsPlaylistFragment.onNext(List) (org.schabi.newpipe.local.history) FeedFragment.onViewCreated(View, Bundle) (org.schabi.newpipe.local.feed) BaseListInfoFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list) Anonymous in getPlaylistObserver() in LocalPlaylistFragment.onNext(List) (org.schabi.newpipe.local.playlist) VideoDetailFragment.runWorker(boolean, boolean) (org.schabi.newpipe.fragments.detail) LocalPlaylistFragment.handleResult(List) (org.schabi.newpipe.local.playlist) SearchFragment.startLoading(boolean) (org.schabi.newpipe.fragments.list.search) SubscriptionFragment.initViews(View, Bundle) (org.schabi.newpipe.local.subscription) InternalUrlsHandler.playOnPopup(Context, String, StreamingService, int, CompositeDisposable) (org.schabi.newpipe.util.external_communication) Anonymous in addClickListenersOnTimestamps() in TextLinkifier.onClick(View) (org.schabi.newpipe.util.external_communication) InternalUrlsHandler.handleUrl(Context, String, Pattern, CompositeDisposable) (org.schabi.newpipe.util.external_communication) ```

It would be great

Stypox commented 2 years ago

Here is how I want to restructure the player (service) start/change logic. These static methods should be accessible from anywhere. They should be callable one after the other: for example, if I want to switch the player and enqueue some items, first I call enqueue and then switchPlayer.

I will try to see if all of these actions (except maybe a part of startPlayer) can be performed without using Intents but rather via the player bound to PlayerHolder.

evermind-zz commented 1 year ago

Here is how I want to restructure the player (service) start/change logic. These static methods should be accessible from anywhere. They should be callable one after the other: for example, if I want to switch the player and enqueue some items, first I call enqueue and ... I will try to see if all of these actions (except maybe a part of startPlayer) can be performed without using Intents but rather via the player bound to PlayerHolder.

What about using a event bus like Greenrobot's EventBus ?