mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Fix MSE Issues (#4725)
* Don't close mse when pausing video * Add message about MSE on iOS
This commit is contained in:
		
							parent
							
								
									7953d131ae
								
							
						
					
					
						commit
						c85df9c691
					
				@ -64,10 +64,11 @@ export default function MsePlayer({ camera, width, height }) {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    video.onpause = () => {
 | 
					    return () => {
 | 
				
			||||||
 | 
					      const video = document.getElementById('video');
 | 
				
			||||||
 | 
					      video.srcObject = null;
 | 
				
			||||||
      ws.close();
 | 
					      ws.close();
 | 
				
			||||||
      video.src = null;
 | 
					    };
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
  }, [url]);
 | 
					  }, [url]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
 | 
				
			|||||||
@ -15,6 +15,7 @@ import { useApiHost } from '../api';
 | 
				
			|||||||
import useSWR from 'swr';
 | 
					import useSWR from 'swr';
 | 
				
			||||||
import WebRtcPlayer from '../components/WebRtcPlayer';
 | 
					import WebRtcPlayer from '../components/WebRtcPlayer';
 | 
				
			||||||
import MsePlayer from '../components/MsePlayer';
 | 
					import MsePlayer from '../components/MsePlayer';
 | 
				
			||||||
 | 
					import videojs from 'video.js';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const emptyObject = Object.freeze({});
 | 
					const emptyObject = Object.freeze({});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -98,6 +99,15 @@ export default function Camera({ camera }) {
 | 
				
			|||||||
  let player;
 | 
					  let player;
 | 
				
			||||||
  if (viewMode === 'live') {
 | 
					  if (viewMode === 'live') {
 | 
				
			||||||
    if (viewSource == 'mse') {
 | 
					    if (viewSource == 'mse') {
 | 
				
			||||||
 | 
					      if (videojs.browser.IS_IOS) {
 | 
				
			||||||
 | 
					        player = (
 | 
				
			||||||
 | 
					          <Fragment>
 | 
				
			||||||
 | 
					            <div className="w-5xl text-center text-sm">
 | 
				
			||||||
 | 
					              MSE is not supported on iOS devices. You'll need to use jsmpeg or webRTC. See the docs for more info.
 | 
				
			||||||
 | 
					            </div>
 | 
				
			||||||
 | 
					          </Fragment>
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
        player = (
 | 
					        player = (
 | 
				
			||||||
          <Fragment>
 | 
					          <Fragment>
 | 
				
			||||||
            <div className="max-w-5xl">
 | 
					            <div className="max-w-5xl">
 | 
				
			||||||
@ -105,6 +115,7 @@ export default function Camera({ camera }) {
 | 
				
			|||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </Fragment>
 | 
					          </Fragment>
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
    } else if (viewSource == 'webrtc') {
 | 
					    } else if (viewSource == 'webrtc') {
 | 
				
			||||||
      player = (
 | 
					      player = (
 | 
				
			||||||
        <Fragment>
 | 
					        <Fragment>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user