To enable the video management function of the RichTextEditor control, you must set up a managed video folder.

This is simply a folder in which you will be placing videos for your users to use in their content. Create a folder in your application's root folder. (For most applications, this is your web server's root folder, or the folder where your Visual Studio .NET project file is located.) The folder can be named something like "/uploads/", "/videos" or "/UserVideo". Use "~/" (tilde) as a substitution of the web-application root directory.

Make sure that the MACHINE/ASPNET user has Read+Write permissions on this folder and its contents.

How to specify the video path?

You can easily specify the video path using the following methods:

Edit security policy file

The security policy file (default.config, admin.config and guest.config) can be found in the richtexteditor/config folder. In security policy file you can find the following code which defines the video path information within RichTextEditor. By default, insert video dialog has the following settings:


<category for="Video"><!-- Insert Video Dialog -->  
       <security name="Extensions">*.swf,*.flv,*.avi,*.mpg,*.mpeg,*.mp3,*.wmv,*.wav,*.mp4,*.mov</security>
       <storage id="default>
              <security name="StoragePath">~/uploads</security>
              <security name="StorageName">Video Files</security><!-- storage display name -->
       </storage>
</category>

If you want to add new folders as video path, you need to create new storages and specify the storgae ID, name, path.

<category for="Video">
       <storage id="newvideopath>
              <security name="StorageName">New Video</security><!-- storage display name -->
              <security name="StoragePath">~/newvideopath</security>
       </storage>
       <storage id="newvideopath2>
              <security name="StorageName">New Video2</security><!-- storage display name -->
              <security name="StoragePath">~/newvideopath2</security>
       </storage>
</category>

Programmatically specify the video path

RichTextEditor provides a powerful method named Editor.SetSecurity that allows you programmatically manage the security settings.

1. Set video path using the default storage

Editor1.SetSecurity("Video", "default", "StoragePath", "~/uploads"); 
Editor1.SetSecurity("Video", "default", "StorageName", "Uploads");

This is equivalent to the following code:

<category for="Video"><!-- Video Dialog -->  
       <storage id="default>
              <security name="StoragePath">~/uploads</security>
              <security name="StorageName">Video Files</security><!-- storage display name -->
       </storage>
</category>

2. Create a new storage for insert video dialog and specify the ID, name and path

Editor1.SetSecurity("Video", "newvideopath", "StoragePath", "~/newvideopath"); 
Editor1.SetSecurity("Video", "newvideopath ", "StorageName", "New Video");

This is equivalent to the following code:

<category for="Video">
       <storage id="newvideopath>
              <security name="StorageName">New Video</security>
              <security name="StoragePath">~/newvideopath</security>
       </storage>
</category>

3. To programmatically disable a storage access, you can use the following method:

Editor1.SetSecurity("Video", "newvideopath", "AllowAccess", "false"); 

In the above code, insert video dialog access to a storage is disabled. The storage ID in the above code is "newvideopath".


Send feedback about this topic to CuteSoft. © 2003 - 2014 CuteSoft Components Inc. All rights reserved.