Skip to content

Commit d7a0713

Browse files
committed
968323: Added documentation for audio and video drag-and-drop.
1 parent 80a30d8 commit d7a0713

File tree

4 files changed

+119
-0
lines changed

4 files changed

+119
-0
lines changed

blazor/rich-text-editor/tools/audio.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,33 @@ N> The default `layoutOption` property is set to `Inline`.
193193
{% endhighlight %}
194194
{% endtabs %}
195195

196+
## Drag and drop audio insertion
197+
198+
By default, the Rich Text Editor allows you to insert audios by drag-and-drop from the local file system such as Windows Explorer into the content editor area. And, you can upload the audios to the server before inserting into the editor by configuring the saveUrl property.
199+
200+
{% tabs %}
201+
{% highlight cshtml %}
202+
203+
{% include_relative code-snippet/audio-draganddrop.razor %}
204+
205+
{% endhighlight %}
206+
{% endtabs %}
207+
208+
### Disabling audio drag and drop
209+
210+
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.
211+
212+
```
213+
<RichTextEditorEvents OnMediaDrop="@OnMediaDrop"></RichTextEditorEvents>
214+
@code{
215+
private void OnMediaDrop(MediaDropEventArgs args)
216+
{
217+
if (args.MediaType == "Audio") {
218+
args.Cancel = true;
219+
}
220+
}
221+
}
222+
```
196223
## Rename audio before inserting
197224

198225
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.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@using Syncfusion.Blazor.RichTextEditor;
2+
3+
<SfRichTextEditor>
4+
<RichTextEditorToolbarSettings Items="@Items" />
5+
<RichTextEditorAudioSettings SaveUrl="@SaveURL" Path="@Path"></RichTextEditorAudioSettings>
6+
<p>
7+
The Rich Text Editor control is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content.
8+
Users can format their content using standard toolbar commands.
9+
</p>
10+
<p><b> Key features:</b></p>
11+
<ul>
12+
<li><p> Provides &lt; IFRAME &gt; and &lt; DIV &gt; modes </p></li>
13+
<li><p> Capable of handling markdown editing.</p></li>
14+
<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
15+
<li><p> Provides a fully customizable toolbar.</p></li>
16+
<li><p> Provides HTML view to edit the source directly for developers.</p></li>
17+
<li><p> Supports third - party library integration.</p></li>
18+
<li><p> Allows preview of modified content before saving it.</p></li>
19+
<li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>
20+
<li><p> Contains undo / redo manager.</p></li>
21+
<li><p> Creates bulleted and numbered lists.</p></li>
22+
</ul>
23+
</SfRichTextEditor>
24+
@code {
25+
private string SaveURL = "https://blazor.syncfusion.com/services/production/api/RichTextEditor/SaveFile";
26+
private string Path = "https://blazor.syncfusion.com/services/production/RichTextEditor/";
27+
private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
28+
{
29+
new ToolbarItemModel() { Command = ToolbarCommand.Audio }
30+
};
31+
}
32+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@using Syncfusion.Blazor.RichTextEditor;
2+
3+
<SfRichTextEditor>
4+
<RichTextEditorToolbarSettings Items="@Items" />
5+
<RichTextEditorVideoSettings SaveUrl="@SaveURL" Path="@Path"></RichTextEditorVideoSettings>
6+
<p>
7+
The Rich Text Editor control is WYSIWYG ('what you see is what you get') editor that provides the best user experience to create and update the content.
8+
Users can format their content using standard toolbar commands.
9+
</p>
10+
<p><b> Key features:</b></p>
11+
<ul>
12+
<li><p> Provides &lt; IFRAME &gt; and &lt; DIV &gt; modes </p></li>
13+
<li><p> Capable of handling markdown editing.</p></li>
14+
<li><p> Contains a modular library to load the necessary functionality on demand.</p></li>
15+
<li><p> Provides a fully customizable toolbar.</p></li>
16+
<li><p> Provides HTML view to edit the source directly for developers.</p></li>
17+
<li><p> Supports third - party library integration.</p></li>
18+
<li><p> Allows preview of modified content before saving it.</p></li>
19+
<li><p> Handles images, hyperlinks, video, hyperlinks, uploads, etc.</p></li>
20+
<li><p> Contains undo / redo manager.</p></li>
21+
<li><p> Creates bulleted and numbered lists.</p></li>
22+
</ul>
23+
</SfRichTextEditor>
24+
@code {
25+
private string SaveURL = "https://blazor.syncfusion.com/services/production/api/RichTextEditor/SaveFile";
26+
private string Path = "https://blazor.syncfusion.com/services/production/RichTextEditor/";
27+
private List<ToolbarItemModel> Items = new List<ToolbarItemModel>()
28+
{
29+
new ToolbarItemModel() { Command = ToolbarCommand.Video }
30+
};
31+
}
32+

blazor/rich-text-editor/tools/video.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,34 @@ N> The default `layoutOption` property is set to `Inline`.
215215
{% endhighlight %}
216216
{% endtabs %}
217217

218+
## Drag and drop video insertion
219+
220+
By default, the Rich Text Editor allows you to insert videos by drag-and-drop from the local file system such as Windows Explorer into the content editor area. And, you can upload the videos to the server before inserting into the editor by configuring the saveUrl property.
221+
222+
{% tabs %}
223+
{% highlight cshtml %}
224+
225+
{% include_relative code-snippet/video-draganddrop.razor %}
226+
227+
{% endhighlight %}
228+
{% endtabs %}
229+
230+
### Disabling videos drag and drop
231+
232+
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.
233+
234+
```
235+
<RichTextEditorEvents OnMediaDrop="@OnMediaDrop"></RichTextEditorEvents>
236+
@code{
237+
private void OnMediaDrop(MediaDropEventArgs args)
238+
{
239+
if (args.MediaType == "Video") {
240+
args.Cancel = true;
241+
}
242+
}
243+
}
244+
```
245+
218246
## Resize video
219247

220248
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.

0 commit comments

Comments
 (0)