0
I have a Web MVC application in which it resumes an audio stream according to the received parameters:
public new ActionResult File(string q, string url)
{
try
{
var query = new GetFileQuery()
{
q = q.Substring(0, 8),
sequencial = q.Substring(8),
path = url
};
if (query.q == query.Hash1)
{
string contentType = MimeMapping.GetMimeMapping(query.fileName);
var cd = new System.Net.Mime.ContentDisposition
{
FileName = query.fileName,
Inline = true,
};
Response.AppendHeader("Content-Disposition", cd.ToString());
query.ConvertWavMP3(query.path);
File(
query.fileBytes
, contentType);
}
}
catch (Exception e)
{
}
return View("Index");
}
However I need that this audio is only for viewing without the download option and the same is in a tag audio, as I call this file on tag and lock the download option?
What do you mean, "for viewing only" ?
– Amadeu Antunes
It would be without the option to download only stream as well as youtube with videos.
– Victor Augusto
your code is more to download even than stream.. take a look at this link you will get help: transmitting-audio-video
– Ricardo Pontual