*/
using System;
+using System.Collections.Generic;
+
+using Tizen;
+using Tizen.Content.MediaContent;
namespace TVMediaHub.Tizen.Models
{
{
return "(MEDIA_TYPE=1)";
}
+
+ public MediaInformation GetRecentlyPlayedVideo()
+ {
+ var contentFilter = new ContentFilter();
+ contentFilter.OrderKey = "MEDIA_LAST_PLAYED_TIME";
+ contentFilter.Order = ContentOrder.Desc;
+ contentFilter.Condition = GetConditionStringForSelection();
+
+ MediaInformation recentlyPlayedVideo = null;
+ IEnumerable<MediaInformation> mediaInformations = null;
+ try
+ {
+ mediaInformations = ContentManager.Database.SelectAll<MediaInformation>(contentFilter);
+ }
+ catch (Exception exception)
+ {
+ Log.Error("MediaHub", exception.Message);
+ }
+
+ foreach (var mediaInformation in mediaInformations)
+ {
+ recentlyPlayedVideo = mediaInformation;
+ break;
+ }
+
+ return recentlyPlayedVideo;
+ }
}
}
\ No newline at end of file