Page 1 of 1

Установка отметки "Фильм просмотрен"

Posted: Wed Mar 13, 2013 6:59 pm
by Eugene
Настройки - Медиа-ресурсы - Обработка - Добавить

Название: "После окончания просмотра фильма" // может быть изменено
Скрипт:

Code: Select all

var
  dtLastPlaybackTime: TDateTime;
begin
  if (CurrentMediaItem <> nil) and (CurrentMediaItem.MediaType = mtVideo) then begin
    if (Pos('[Просмотрен]', CurrentMediaItem.Properties[mpiTitle]) = 0) then begin
      if VarToStr(CurrentMediaItem.Properties[mpiLastPlaybackTime]) <> '' then try
        dtLastPlaybackTime := CurrentMediaItem.Properties[mpiLastPlaybackTime];
        if (Now - dtLastPlaybackTime) > EncodeTime(0, 1, 0, 0) then // 1 минута
          CurrentMediaItem.Properties[mpiTitle] := '[Просмотрен] ' + CurrentMediaItem.Properties[mpiTitle]
      except end    
    end    
  end    
end.
Ok - Ok

Настройки - События - "После завершения воспроизведения медиа-ресурса" - "После окончания просмотра фильма" - Ok