#201 adding Accept-Ranges to mp3 response + preparing client to be published
This commit is contained in:
parent
c0bc3127a2
commit
fad601c07b
@ -143,7 +143,7 @@
|
||||
</p>
|
||||
|
||||
<script src="~/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="~/js/bh.js"></script>
|
||||
<script src="~/js/bi.js"></script>
|
||||
<script src="~/js/vaabd.js"></script>
|
||||
<script src="~/dist/jplayer/jquery.jplayer.min.js"></script>
|
||||
<script src="~/dist/add-on/jplayer.playlist.min.js"></script>
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
<script>
|
||||
var playerScrollLock = false;
|
||||
</script>
|
||||
<script src="/js/bh.js"></script>
|
||||
<script src="/js/bi.js"></script>
|
||||
|
||||
@if (Model.IsHomePage)
|
||||
{
|
||||
|
||||
@ -181,7 +181,7 @@
|
||||
</div>
|
||||
|
||||
<script src="/lib/jquery/dist/jquery.min.js"></script>
|
||||
<script src="/js/bh.js"></script>
|
||||
<script src="/js/bi.js"></script>
|
||||
<script src="/js/vaabd.js"></script>
|
||||
|
||||
@if (!string.IsNullOrEmpty(ViewData["GoogleAnalyticsCode"].ToString()))
|
||||
|
||||
@ -173,6 +173,7 @@ namespace RMuseum.Controllers
|
||||
return NotFound();
|
||||
|
||||
Response.GetTypedHeaders().LastModified = narration.Result.UploadDate;//TODO: Add a FileLastUpdated field to narrations to indicate the last time the mp3/xml files have been updated
|
||||
|
||||
|
||||
var requestHeaders = Request.GetTypedHeaders();
|
||||
if (requestHeaders.IfModifiedSince.HasValue &&
|
||||
@ -181,6 +182,8 @@ namespace RMuseum.Controllers
|
||||
return StatusCode(StatusCodes.Status304NotModified);
|
||||
}
|
||||
|
||||
HttpContext.Response.Headers.Add("Accept-Ranges", "bytes");
|
||||
|
||||
return new FileStreamResult(new FileStream(narration.Result.LocalMp3FilePath, FileMode.Open, FileAccess.Read), "audio/mpeg");
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user