Skip to content
Open
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
29 changes: 29 additions & 0 deletions blazor/rich-text-editor/tools/audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,35 @@ N> The default `layoutOption` property is set to `Inline`.
{% endhighlight %}
{% endtabs %}

## Drag and drop audio insertion

Default upload: Insert audio directly from your local file system (e.g., File Explorer, Finder) into the editor.

Server upload: Use the `SaveUrl` property to upload audio files to your server before inserting them into the editor.

{% tabs %}
{% highlight cshtml %}

{% include_relative code-snippet/audio-drag-and-drop.razor %}

{% endhighlight %}
{% endtabs %}

### Disabling audio drag and drop

You can prevent drag-and-drop action by setting the `OnMediaDrop` argument cancel value to true. The following code shows how to prevent the drag-and-drop.

```
<RichTextEditorEvents OnMediaDrop="@OnMediaDrop"></RichTextEditorEvents>
@code{
private void OnMediaDrop(MediaDropEventArgs args)
{
if (args.MediaType == "Audio") {
args.Cancel = true;
}
}
}
```
## Rename audio before inserting

Using the [RichTextEditorAudioSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorAudioSettings.html) property, specify the server handler to upload the selected audio. Then, by binding the `FileUploadSuccess` event, you will receive the modified file name from the server and update it in the Rich Text Editor's insert audio dialog.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@using Syncfusion.Blazor.RichTextEditor;

<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Items" />
<RichTextEditorAudioSettings SaveUrl="@saveUrl" Path="@path"></RichTextEditorAudioSettings>
<p>
The Rich Text Editor supports seamless audio insertion through drag-and-drop functionality. Users can quickly insert audio files into their content with a simple drag-and-drop action.
</p>
<p><b>Key features:</b></p>
<ul>
<li>Supports local upload: Drag audio files from your local system (e.g., File Explorer, Finder) and drop them
directly into the editor.</li>
<li>Supports server upload: Configure the <code>SaveUrl</code> property to upload audio files to your server
before inserting them into the editor.</li>
<li>Supports common audio formats such as MP3, WAV, and M4A ,WMA</li>
<li>Fully customizable upload settings, including size limits and validation.</li>
</ul>
</SfRichTextEditor>
@code {
private string saveUrl = "https://blazor.syncfusion.com/services/production/api/RichTextEditor/SaveFile";
private string path = "https://blazor.syncfusion.com/services/production/RichTextEditor/";
private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.Audio }
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@using Syncfusion.Blazor.RichTextEditor;

<SfRichTextEditor>
<RichTextEditorToolbarSettings Items="@Items" />
<RichTextEditorVideoSettings SaveUrl="@saveUrl" Path="@path"></RichTextEditorVideoSettings>
<p>
The Rich Text Editor supports seamless video insertion through drag-and-drop functionality. Users can quickly insert video files into their content with a simple drag-and-drop action.
</p>
<p><b>Key features:</b></p>
<ul>
<li>Supports local upload: Drag video files from your local system (e.g., File Explorer, Finder) and drop them
directly into the editor.</li>
<li>Supports server upload: Configure the <code>SaveUrl</code> property to upload video files to your server
before inserting them into the editor.</li>
<li>Supports common video formats such as MP4, WMV, AVI and MOV</li>
<li>Fully customizable upload settings, including size limits and validation.</li>
</ul>
</SfRichTextEditor>
@code {
private string saveUrl = "https://blazor.syncfusion.com/services/production/api/RichTextEditor/SaveFile";
private string path = "https://blazor.syncfusion.com/services/production/RichTextEditor/";
private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
{
new ToolbarItemModel() { Command = ToolbarCommand.Video }
};
}

30 changes: 30 additions & 0 deletions blazor/rich-text-editor/tools/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,36 @@ N> The default `layoutOption` property is set to `Inline`.
{% endhighlight %}
{% endtabs %}

## Drag and drop video insertion

Default upload: Insert video directly from your local file system (e.g., File Explorer, Finder) into the editor.

Server upload: Use the `SaveUrl` property to upload video files to your server before inserting them into the editor.

{% tabs %}
{% highlight cshtml %}

{% include_relative code-snippet/video-drag-and-drop.razor %}

{% endhighlight %}
{% endtabs %}

### Disabling videos drag and drop

You can prevent drag-and-drop action by setting the `OnMediaDrop` argument cancel value to true. The following code shows how to prevent the drag-and-drop.

```
<RichTextEditorEvents OnMediaDrop="@OnMediaDrop"></RichTextEditorEvents>
@code{
private void OnMediaDrop(MediaDropEventArgs args)
{
if (args.MediaType == "Video") {
args.Cancel = true;
}
}
}
```

## Resize video

The Rich Text Editor has built-in video resizing support, which is enabled for the video elements added. The resize points will appear on each corner of the video when focusing so users can easily resize the video using mouse points or thumb through the resize points. Also, the resize calculation will be done based on the aspect ratio.
Expand Down