You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 line
907 B

  1. using Microsoft.AspNetCore.Builder;
  2. using Microsoft.AspNetCore.StaticFiles;
  3. using Microsoft.Extensions.Logging;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. namespace JT1078.Gateway.SimpleServer.HLS
  8. {
  9. public class Startup
  10. {
  11. public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory)
  12. {
  13. //mime
  14. //https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/DeployingHTTPLiveStreaming/DeployingHTTPLiveStreaming.html
  15. var Provider = new FileExtensionContentTypeProvider();
  16. Provider.Mappings[".m3u8"] = "application/x-mpegURL,vnd.apple.mpegURL";
  17. Provider.Mappings[".ts"] = "video/MP2T";
  18. app.UseStaticFiles(new StaticFileOptions()
  19. {
  20. ContentTypeProvider = Provider
  21. });
  22. }
  23. }
  24. }