Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public async Task<IActionResult> ScormContent(string filePath)

var directory = filePath.Substring(0, filePath.LastIndexOf("/"));
fileName = filePath.Substring(filePath.LastIndexOf("/") + 1, filePath.Length - filePath.LastIndexOf("/") - 1);
string extension = Path.GetExtension(fileName);

var file = await this.fileService.DownloadFileAsync(directory, fileName);

Expand All @@ -95,6 +96,11 @@ public async Task<IActionResult> ScormContent(string filePath)
contentType = "application/octet-stream";
}

if (extension == ".mp4")
{
contentType = "application/x-mpegURL";
}

result = this.File(file.Content, contentType);
bytesServed = file.ContentLength;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@
// ]
// }
//};

this.player.load(sourceConfig)
.then(() => {
console.log("Source loaded successfully!");
Expand Down Expand Up @@ -723,7 +722,14 @@
async launchScorm() {
var targetWin;
var targetWinName = "lhContent" + this.resourceItem.resourceId;
// Use a placeholder window to avoid popup blockers
targetWin = window.open("about:blank", targetWinName, "location=0,menubar=0,resizable=0,width=" + this.resourceItem.scormDetails.popupWidth + ",height=" + this.resourceItem.scormDetails.popupHeight);

// If the pop-up was blocked
if (!targetWin) {
alert("Please allow pop-ups to view this content.");
return;
}
var activeContent = await userData.getActiveContent();

if (activeContent.filter(ac => ac.resourceId === this.resourceItem.resourceId).length > 0) {
Expand Down
Loading