Wild Media Server Wild Media Server
 
 
 
E-Mail Us
Home Product Info Download Buy Forum Feedback Extend Trial Contact Us Sitemap
 
It is currently Fri Sep 21, 2018 3:41 am

All times are UTC




Post new topic  Reply to topic  [ 1 post ] 
Author Message
PostPosted: Sun Mar 04, 2012 8:38 pm 

Joined: Tue Nov 17, 2009 8:05 pm
Posts: 2901
This example demonstrates the ability to create dynamic folders and copying script to properties of child folders for creating further levels of navigation.

The folder Collections - right click - Add folder
Title: Realtime folders
Type: Dynamic (script)
click Script

Expression
Code:
const
  mpiFolderType         = 200; 
  mpiDynamicScript      = 500;
  mpiDynamicSyntaxType  = 501; 

function ItemLevel(aItem: TWmsScriptMediaItem): Integer;
begin
  Result := -1;
  while aItem <> nil do begin
    aItem := aItem.ItemParent;
    Inc(Result)
  end   
end;

var
  ChildFolder: TWmsScriptMediaItem; 
  i: Integer;
begin
//  WmsLogMessage(mtiInfo, FolderItem.Properties[mpiTitle]);
  if ItemLevel(FolderItem) < 10 then begin
    for i := 1 to 5 do begin
      ChildFolder := FolderItem.AddFolder(FolderItem.Properties[mpiTitle] + '_' + IntToStr(i));
      if ChildFolder <> nil then begin   
        ChildFolder.Properties[mpiFolderType] := FolderItem.Properties[mpiFolderType];       
        ChildFolder.Properties[mpiDynamicScript] := FolderItem.Properties[mpiDynamicScript];
        ChildFolder.Properties[mpiDynamicSyntaxType] := FolderItem.Properties[mpiDynamicSyntaxType];       
      end
    end   
  end else 
    for i := 1 to 5 do         
      WmsCreateMediaItem(FolderItem.Properties[mpiTitle] + '_Item_' + IntToStr(i), FolderItem.ItemID);
end.

Ok - Ok

Attachment:
realtime_folders.jpg
realtime_folders.jpg [ 134.71 KiB | Viewed 8020 times ]


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1 post ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Copyright 2009-2018 Wild Media Server Powered by phpBB® Forum Software © phpBB Limited