mirror of
				https://github.com/videojs/video.js.git
				synced 2025-10-31 00:08:01 +02:00 
			
		
		
		
	fix: Safari picture-in-picture triggers fullscreenchange (#4437)
When picture-in-picture mode is entered on Safari, `webkitbeginfullscreen` is triggered which results in a proxied `fullscreenchange` event and adding the fullscreen class to the player. That causes the tech element to collapse to zero height so that the "this video is playing in picture in picture" placeholder is not visible. On `webkitbeginfullscreen` check whether the presentation mode is `picture-in-picture` before proxying `fullscreenchange` event.
This commit is contained in:
		
				
					committed by
					
						 Gary Katsevman
						Gary Katsevman
					
				
			
			
				
	
			
			
			
						parent
						
							77ba3d13d9
						
					
				
				
					commit
					b63666379d
				
			| @@ -432,9 +432,12 @@ class Html5 extends Tech { | ||||
|     }; | ||||
|  | ||||
|     const beginFn = function() { | ||||
|       this.one('webkitendfullscreen', endFn); | ||||
|       if ('webkitPresentationMode' in this.el_ && | ||||
|         this.el_.webkitPresentationMode !== 'picture-in-picture') { | ||||
|         this.one('webkitendfullscreen', endFn); | ||||
|  | ||||
|       this.trigger('fullscreenchange', { isFullscreen: true }); | ||||
|         this.trigger('fullscreenchange', { isFullscreen: true }); | ||||
|       } | ||||
|     }; | ||||
|  | ||||
|     this.on('webkitbeginfullscreen', beginFn); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user