Hi
Its possible make something similar like your sample for play videos, but in blazor wasm?
Opening video files in FileExplorer | Syncfusion | ASP.NET Web Forms - FileExplorer
Thanks in advance!
|
<SfFileManager @ref="filemanager" ID="filemanager" TValue="FileManagerDirectoryContent" >
<FileManagerEvents TValue="FileManagerDirectoryContent" OnFileOpen="FileOpen" ></FileManagerEvents>
<FileManagerAjaxSettings Url="/api/Home/FileOperations"
UploadUrl="/api/Home/Upload"
DownloadUrl="/api/Home/Download"
GetImageUrl="/api/Home/GetImage">
</FileManagerAjaxSettings>
</SfFileManager>
<SfDialog @ref="Dialog" Width="447px" Target="#filemanager" ShowCloseIcon="true" @bind-Visible="@IsVisible">
<DialogEvents OnOpen="open" Closed="close"></DialogEvents>
<DialogTemplates>
<Header> Video File </Header>
<Content>
<video id="videoTagId" controls="controls" width="400px" height="262px">
<source src=@source>
</video>
</Content>
</DialogTemplates>
</SfDialog>
@code{
SfDialog Dialog;
SfFileManager<FileManagerDirectoryContent> filemanager;
private bool IsVisible { get; set; } = false;
public string source { get; set; } = "";
private void open()
{
// need to call the load event of video
jsRuntime.InvokeAsync<string>("loadVideo");
}
public void close()
{
// changes the source attriute and call the load event of the video.
this.source = "";
jsRuntime.InvokeAsync<string>("loadVideo");
}
public void FileOpen(Syncfusion.Blazor.FileManager.FileOpenEventArgs<FileManagerDirectoryContent> args)
{
if ((args.FileDetails.IsFile == true) && args.FileDetails.Type == ".mp4")
{
this.IsVisible = true;
// update the path for source attribute.
this.source = args.FileDetails.FilterPath.Replace("\\", "/") + args.FileDetails.Name;
}
}
}
Host.Cshtml
<script>
function loadVideo()
{
document.getElementById("videoTagId").load();
}
</script> |
Hi Sowmiya
I cannot download sample file, I get The Syncfusion account you logged in to is not associated with this download. Please use the Syncfusion account associated with the file you are trying to download.
Please help!
Thanks I was able to get run this sample in my code!