Setting up the Video Path

Rich Text Editor for PHP

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. The folder can be named something like "/uploads/", "/videos" or "/UserVideo".

Make sure that the Internet Guest Account 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

$rte->SetSecurity("Video", "default", "StoragePath", "~/uploads"); 
$rte->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

$rte->SetSecurity("Video", "newvideopath", "StoragePath", "~/newvideopath"); 
$rte->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:

$rte->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 - 2012 CuteSoft Components Inc. All rights reserved.