z
This commit is contained in:
		@@ -16,17 +16,23 @@ events {
 | 
			
		||||
rtmp {
 | 
			
		||||
    server {
 | 
			
		||||
        listen 1935;
 | 
			
		||||
        chunk_size 4096;
 | 
			
		||||
 | 
			
		||||
        application live {
 | 
			
		||||
            live on;
 | 
			
		||||
            record off;
 | 
			
		||||
            hls on;
 | 
			
		||||
            hls_path temp/hls;
 | 
			
		||||
            hls_fragment 1s;
 | 
			
		||||
            hls_playlist_length 10s;
 | 
			
		||||
        }
 | 
			
		||||
		
 | 
			
		||||
        application hls {
 | 
			
		||||
            live on;
 | 
			
		||||
            hls on;  
 | 
			
		||||
            hls_path temp/hls;  
 | 
			
		||||
            hls_fragment 8s;  
 | 
			
		||||
        }
 | 
			
		||||
        # application hls {
 | 
			
		||||
        #     live on;
 | 
			
		||||
        #     hls on;  
 | 
			
		||||
        #     hls_path temp/hls;  
 | 
			
		||||
        #     hls_fragment 8s;  
 | 
			
		||||
        # }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -94,6 +100,25 @@ http {
 | 
			
		||||
        #}
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    #   hls
 | 
			
		||||
    server {
 | 
			
		||||
        listen 8080; # A non-standard port is good for local services.
 | 
			
		||||
 | 
			
		||||
        location /hls {
 | 
			
		||||
            # Serve HLS files
 | 
			
		||||
            types {
 | 
			
		||||
                application/vnd.apple.mpegurl m3u8;
 | 
			
		||||
                video/mp2t ts;
 | 
			
		||||
            }
 | 
			
		||||
            # The path here MUST match the hls_path from the rtmp block
 | 
			
		||||
            alias temp/hls; 
 | 
			
		||||
            
 | 
			
		||||
            # Add headers to prevent caching and allow cross-domain playback
 | 
			
		||||
            add_header Cache-Control 'no-cache';
 | 
			
		||||
            add_header Access-Control-Allow-Origin '*' always;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    # another virtual host using mix of IP-, name-, and port-based configuration
 | 
			
		||||
    #
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user