itunes and “remember playback position”

iTunes won’t automatically bookmark your video files playback postiton so you can resume where you left off. You need to right click on the track, select “get info” and check “remember playback postion” under the options tab. Unfortunately there is no way to do multiple tracks at once. Here is a c# code snippet that takes the selected items in the itunes browser window and sets the “remember playback position” to true. You will need to add a reference to the iTunes type COM library.

 

 

    1 using System;

    2 using System.Collections.Generic;

    3 using System.Text;

    4 using iTunesLib;

    5

    6 namespace RemeberPlaybackPostion

    7 {

    8     class Program

    9     {

   10         static void Main(string[] args)

   11         {

   12             iTunesApp app = new iTunesAppClass();

   13

   14             // IITTrackCollection tracks = app.LibraryPlaylist.Tracks;

   15             IITTrackCollection tracks = app.BrowserWindow.SelectedTracks;

   16

   17             if(tracks == null)

   18             {

   19                 return;

   20             }

   21

   22             Console.WriteLine(“{0} tracks selected.”, tracks.Count);

   23

   24             for (int i = 0; i < tracks.Count; i++)

   25             {

   26                 IITTrack track = tracks[i + 1];

   27                 IITFileOrCDTrack vidTrack = track as IITFileOrCDTrack;

   28                 if (vidTrack != null)

   29                 {

   30                     vidTrack.RememberBookmark = true;

   31                     Console.WriteLine(“{0} RememberBookmark set to {1}”, vidTrack.Name, vidTrack.RememberBookmark);

   32                 }

   33                 else

   34                 {

   35                     Console.WriteLine(“Skipping {0}”, track.Name);

   36                 }

   37             }

   38             Console.WriteLine(“Done.”);

   39             Console.ReadLine();

   40

   41

   42

   43         }

   44     }

   45 }

 

 


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.