mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Add option to hide thumbnail on lock screen and inside notification
This commit is contained in:
		| @@ -146,7 +146,11 @@ public final class NotificationUtil { | ||||
|         notificationBuilder.setContentText(player.getUploaderName()); | ||||
|         notificationBuilder.setTicker(player.getVideoTitle()); | ||||
|         updateActions(notificationBuilder, player); | ||||
|         setLargeIcon(notificationBuilder, player); | ||||
|         final boolean showThumbnail = player.sharedPreferences.getBoolean( | ||||
|                 player.context.getString(R.string.show_thumbnail_key), true); | ||||
|         if (showThumbnail) { | ||||
|             setLargeIcon(notificationBuilder, player); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -671,9 +671,13 @@ public class VideoPlayerImpl extends VideoPlayer | ||||
|         super.onUpdateProgress(currentProgress, duration, bufferPercent); | ||||
|         updateProgress(currentProgress, duration, bufferPercent); | ||||
|  | ||||
|         final boolean showThumbnail = | ||||
|                 sharedPreferences.getBoolean( | ||||
|                         context.getString(R.string.show_thumbnail_key), | ||||
|                         true); | ||||
|         // setMetadata only updates the metadata when any of the metadata keys are null | ||||
|         mediaSessionManager.setMetadata(getVideoTitle(), getUploaderName(), getThumbnail(), | ||||
|                 duration); | ||||
|         mediaSessionManager.setMetadata(getVideoTitle(), getUploaderName(), | ||||
|                 showThumbnail ? getThumbnail() : null, duration); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 XiangRongLin
					XiangRongLin