mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Add comment about broadcast receiver
This commit is contained in:
		| @@ -663,6 +663,12 @@ public final class Player implements PlaybackListener, Listener { | |||||||
|     //////////////////////////////////////////////////////////////////////////*/ |     //////////////////////////////////////////////////////////////////////////*/ | ||||||
|     //region Broadcast receiver |     //region Broadcast receiver | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * This function prepares the broadcast receiver and is called only in the constructor. | ||||||
|  |      * Therefore if you want any PlayerUi to receive a broadcast action, you should add it here, | ||||||
|  |      * even if that player ui might never be added to the player. In that case the received | ||||||
|  |      * broadcast would not do anything. | ||||||
|  |      */ | ||||||
|     private void setupBroadcastReceiver() { |     private void setupBroadcastReceiver() { | ||||||
|         if (DEBUG) { |         if (DEBUG) { | ||||||
|             Log.d(TAG, "setupBroadcastReceiver() called"); |             Log.d(TAG, "setupBroadcastReceiver() called"); | ||||||
|   | |||||||
| @@ -55,6 +55,10 @@ public abstract class PlayerUi { | |||||||
|     public void onFragmentListenerSet() { |     public void onFragmentListenerSet() { | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * If you want to register new broadcast actions to receive here, add them to | ||||||
|  |      * {@link Player#setupBroadcastReceiver()}. | ||||||
|  |      */ | ||||||
|     public void onBroadcastReceived(final Intent intent) { |     public void onBroadcastReceived(final Intent intent) { | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Stypox
					Stypox