Page tree


Search

  Wiki Navigation

    Loading...


 Recently Updated


 Latest Releases

 MediaPortal 1.23 
            Releasenews | Download
 MediaPortal 2.2.2
            Releasenews | Download

Purpose

  • Required:  No
  • Type of Change:  Feature

Since 1.4 there is a timeline with comskip markers for videos and recorded TV (Comskip / Chapter Markers for MyVideo). These markers can be made available for other video plugins, too. They are not necessarily limited to commercials detected by comskip, but any parts of the video can be marked (e.g. in MyVideos  the start of each chapter in a multi-chapter video is indicated).

Description of Change

The marker data is contained in two new skin properties:
#jumppoints
#chapters

which can be used by the skin designers to provide the tvprogress control's tags in VideoFullscreen.xml and VideoOSD.xml with the proper values. The skin properties have to be set by the plugin playing the video before. This can be done by providing an own version of the g_player.ShowFullScreenWindowVideoDefault() method in the video plugin code that cares for setting the properties.

Additional Information and References

See also: Comskip / Chapter Markers for MyVideo


Mantis Issue:

https://issues.team-mediaportal.com/browse/MP1-4156

Related xml(s):


Windows IDs:


Related GUI control:

GUITVProgressControl

Author:

michael_t

Date added:

Fri, 16 Aug 2013

XML/Code Samples

Example taken from GUIVideoFiles.cs:

    public override void OnAdded()
    \{

      // ...

      // replace g_player's ShowFullScreenWindowVideoDefault()
      g_Player.ShowFullScreenWindowVideo = ShowFullScreenWindowVideoHandler;

      // ...

    \}

    /// <summary>
    /// This function replaces g_player.ShowFullScreenWindowVideoDefault()
    /// </summary>
    /// <returns></returns>
    private static bool ShowFullScreenWindowVideoHandler()
    \{
      if (g_Player.HasVideo && g_Player.HasChapters)
      \{
        // Take chapter and jumppoint information to set the optical timeline markers
        double\[\] jumppoints = g_Player.JumpPoints;
        double\[\] chapters = g_Player.Chapters;
        double duration = g_Player.Duration;
        string strJumpPoints = string.Empty;
        string strChapters = string.Empty;
        if (jumppoints != null)
        \{
          // Set the marker start to indicate the start of commercials
          foreach (double jump in jumppoints)
          \{
            double jumpPercent = jump / duration \* 100.0d;
            strJumpPoints \+= String.Format("\{0:0.00\}", jumpPercent) \+ " ";
          \}
          // Set the marker end to indicate the end of commercials
          foreach (double chapter in chapters)
          \{
            double chapterPercent = chapter / duration \* 100.0d;
            strChapters \+= String.Format("\{0:0.00\}", chapterPercent) \+ " ";
          \}
        \}
        else
        \{
          // Set a fixed size marker at the start of each chapter
          double markerWidth = 0.7d;
          foreach (double chapter in chapters)
          \{
            double chapterPercent = chapter / duration \* 100.0d;
            strChapters \+= String.Format("\{0:0.00\}", chapterPercent) \+ " ";
            chapterPercent = (chapterPercent >= markerWidth) ? chapterPercent \- markerWidth : 0.0d;
            strJumpPoints \+= String.Format("\{0:0.00\}", chapterPercent) \+ " ";
          \}
        \}
        
        // Set chapters and jumppoints GUI properties
        GUIPropertyManager.SetProperty("#chapters", strChapters);
        GUIPropertyManager.SetProperty("#jumppoints", strJumpPoints);
        Log.Debug("GUIVideoFiles.ShowFullScreenWindowVideoHandler: setting chapters: " \+ strChapters);
        Log.Debug("GUIVideoFiles.ShowFullScreenWindowVideoHandler: setting jumppoints: " \+ strJumpPoints);
      \}
      else
      \{
        GUIPropertyManager.SetProperty("#chapters", string.Empty);
        GUIPropertyManager.SetProperty("#jumppoints", string.Empty);
      \}
      // Continue with the default handler
      return g_Player.ShowFullScreenWindowVideoDefault();
    \}

 
 


Screenshots



   

 

This page has no comments.