Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow downloading transcriptions on watchLectureVideos page #86

Open
chirantan31 opened this issue Jan 24, 2019 · 1 comment
Open

Allow downloading transcriptions on watchLectureVideos page #86

chirantan31 opened this issue Jan 24, 2019 · 1 comment
Assignees

Comments

@chirantan31
Copy link
Collaborator

No description provided.

@angrave
Copy link
Contributor

angrave commented Jan 27, 2019

Current implementation seems to get the transcriptions from the client
transcriptions = JSON.parse(request.body.transcriptions);
Better - get the transcriptions from the server and immediately stream it as content to be downloaded. There is no need to create a new file and then a secondary request to read that file.
https://stackoverflow.com/questions/10046039/nodejs-send-file-in-response
if( can-create-vtt-stream)
response.writeHead(200, {
"Content-Type": "application/octet-stream",
"Content-Disposition": "attachment; filename=" + captions_name_vtt
});
outputsstream.pipe(response);
} else {
response.writeHead(400, {"Content-Type": "text/plain"});
response.end("Requested Transcriptions do not exist or you do not have access);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants