Gets the current playback time.
public int CurrentTime { get; } Public ReadOnly Property CurrentTime As Integer public:property int CurrentTime {int get();}
The current playback time. A value of -1 indicates that the movie is non-linear, meaning that it does not have seekable timecodes.
This value is a DVD_HMSF_TIMECODE structure. Other "current" information can be found in the following properties: CurrentTitle, CurrentChapter, CurrentDiscSide, CurrentVolume, CurrentButton, CurrentAngle, CurrentUOPS, CurrentAudioStream, CurrentSubpictureStream, and CurrentDomain.
For more detailed information, refer to the Microsoft documentation for IDvdInfo2.GetCurrentLocation.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public PlayCtrlForm _form = new PlayCtrlForm();public PlayCtrl _playctrl;public void IsAudioStreamEnabledExample(){// reference the play control_playctrl = _form.PlayCtrl;string inFile = Path.Combine(LEAD_VARS.MediaDir, @"VIDEO_TS\VIDEO_TS.IFO");try{// set auto start off_playctrl.AutoStart = false;// use DVDSource_playctrl.UseDVDSource = true;// set the input file_playctrl.SourceFile = inFile;// check the DVD optionsDvdInfoCheck();// play it_playctrl.Run();}catch (Exception){_result = false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (_playctrl.State == PlayState.Running)Application.DoEvents();}// check DVD properties and infoprivate void DvdInfoCheck(){string bstrVal;int val;int button = _playctrl.DvdController.CurrentButton;val = _playctrl.DvdController.GetButtonWidth(button);val = _playctrl.DvdController.GetButtonHeight(button);val = _playctrl.DvdController.GetButtonLeft(button);val = _playctrl.DvdController.GetButtonTop(button);val = _playctrl.DvdController.DefaultMenuLanguage;_playctrl.DvdController.DefaultMenuLanguage = 1033;val = _playctrl.DvdController.GetNumberOfChapters(0);val = _playctrl.DvdController.TotalTitleTime;DVDTimecodeFlags tcFlags = _playctrl.DvdController.TitleTimecodeFlags;val = _playctrl.DvdController.CurrentAngle;if (_playctrl.DvdController.AnglesAvailable > 1)_playctrl.DvdController.CurrentAngle = 2;DVDValidUserOp userOp = _playctrl.DvdController.CurrentUOPS;long audioLang = _playctrl.DvdController.GetAudioLanguage(0);val = _playctrl.DvdController.CurrentAudioStream;if (_playctrl.DvdController.AudioStreamsAvailable > 1)_playctrl.DvdController.CurrentAudioStream = 2;val = _playctrl.DvdController.CurrentTime;val = _playctrl.DvdController.CurrentVolume;val = _playctrl.DvdController.VolumesAvailable;val = _playctrl.DvdController.TitlesAvailable;bool enabled = _playctrl.DvdController.IsAudioStreamEnabled(0);val = _playctrl.DvdController.DefaultAudioLanguage;_playctrl.DvdController.SelectDefaultAudioLanguage(1033, DVDAudioLangExt.Captions);string directory = _playctrl.DvdController.DVDDirectory;val = _playctrl.DvdController.CurrentSubpictureStream;val = _playctrl.DvdController.SubpictureStreamsAvailable;if ((val > 1)){_playctrl.DvdController.CurrentSubpictureStream = 1;}val = _playctrl.DvdController.DefaultSubpictureLanguage;_playctrl.DvdController.SelectDefaultSubpictureLanguage(1033, DVDSubpictureLangExt.Caption_Normal);val = _playctrl.DvdController.CurrentTitle;DVDSubpictureLangExt subPicLangExt = _playctrl.DvdController.DefaultSubpictureLanguageExt;DVDAudioLangExt audioLangExt = _playctrl.DvdController.DefaultAudioLanguageExt;long subpicLang = _playctrl.DvdController.GetSubpictureLanguage(0);bool subPicStream = _playctrl.DvdController.IsSubpictureStreamEnabled(0);val = _playctrl.DvdController.GetDVDTextLanguageLCID(0);val = _playctrl.DvdController.DVDTextNumberOfLanguages;val = _playctrl.DvdController.GetGPRM(0);_playctrl.DvdController.SetGPRM(0, 1);val = _playctrl.DvdController.GetDVDTextNumberOfStrings(0);val = _playctrl.DvdController.ButtonsAvailable;val = _playctrl.DvdController.PlayerParentalLevel;val = _playctrl.DvdController.PlayerParentalCountry;string ppCountry = string.Format("{0}{1}", (char)(val & 0xFF), (char)(val >> 8));if (ppCountry != "US"){val = (int)'U';val += ((int)'S' << 8);_playctrl.DvdController.SelectParentalCountry(val, "user", "pwd");}val = _playctrl.DvdController.GetTitleParentalLevels(-1);_playctrl.DvdController.SelectParentalLevel(9, "user", "pwd");DVDDomain domain = _playctrl.DvdController.CurrentDomain;DVDDiscSide diskSide = _playctrl.DvdController.CurrentDiscSide;val = _playctrl.DvdController.CurrentChapter;DVDTextStringType textStrType = _playctrl.DvdController.GetDVDTextStringType(0, 0);if (!_playctrl.DvdController.SubpictureOn)_playctrl.DvdController.SubpictureOn = true;val = _playctrl.DvdController.GetSPRM(0);bstrVal = _playctrl.DvdController.GetDVDTextString(0, 0);bstrVal = _playctrl.DvdController.DVDUniqueID;}// menu event helpers for DVD navigation and controlprivate void mnAcceptParentalLevelChange_Click(){_playctrl.DvdController.AcceptParentalLevelChange(true);}private void mnActivateAtPosition_Click(){_playctrl.DvdController.ActivateAtPosition(10, 10);}private void mnActivateButton_Click(){_playctrl.DvdController.ActivateButton();}private void mnChangeDVDRegion_Click(){_playctrl.DvdController.ChangeDVDRegion(_form);}private void mnNotifyParentalLevelChange_Click(){_playctrl.DvdController.NotifyParentalLevelChange(true);}private void mnPause_Click(){_playctrl.DvdController.Pause(true);}private void mnPlayAtInTitle_Click(){_playctrl.DvdController.PlayAtTimeInTitle(1, 10000000);}private void mnPlayAtTime_Click(){_playctrl.DvdController.PlayAtTime(10000000);}private void mnPlaybackword_Click(){_playctrl.DvdController.PlayBackwards(5);}private void mnPlayChapter_Click(){_playctrl.DvdController.PlayChapter(1);}private void mnPlaychapterautostop_Click(){_playctrl.DvdController.PlayChaptersAutoStop(1, 2, 5);}private void mnPlaychapterintitle_Click(){_playctrl.DvdController.PlayChapterInTitle(1, 3);}private void mnPlayfowrward_Click(){_playctrl.DvdController.PlayForwards(5);}private void mnPlayNextChapter_Click(){_playctrl.DvdController.PlayNextChapter();}private void mnPlayperiod_Click(){_playctrl.DvdController.PlayPeriodInTitleAutoStop(1, 30, 120);}private void mnPlayPrevChapter_Click(){_playctrl.DvdController.PlayPrevChapter();}private void mnPlaytitle_Click(){_playctrl.DvdController.PlayTitle(1);}private void mnReplayChapter_Click(){_playctrl.DvdController.ReplayChapter();}private void mnResume_Click(){_playctrl.DvdController.Resume();}private void mnReturnfromsubmenu_Click(){_playctrl.DvdController.ReturnFromSubmenu();}private void mnSelectAndActivateButton_Click(){_playctrl.DvdController.SelectAndActivateButton(1);}private void mnSelectAtPosition_Click(){_playctrl.DvdController.SelectAtPosition(10, 10);}private void mnSelectButton_Click(){_playctrl.DvdController.SelectButton(1);}private void mnSelectRelativeButton_Click(){_playctrl.DvdController.SelectRelativeButton(DVDRelativeButton.Right);}private void mnSetDVDDirectory_Click(){_playctrl.DvdController.DVDDirectory = @"e:\video_ts";}private void mnShowMenu_Click(){_playctrl.DvdController.ShowMenu(DVDMenuId.Root);}private void mnStillOff_Click(){_playctrl.DvdController.StillOff();}private void mnStop_Click(){_playctrl.DvdController.Stop();}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media";}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As PlayCtrlForm = New PlayCtrlForm()Public _playctrl As PlayCtrlPublic Sub IsAudioStreamEnabledExample()' reference the play control_playctrl = _form.PlayCtrlDim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "VIDEO_TS\VIDEO_TS.IFO")Try' set auto start off_playctrl.AutoStart = False' use DVDSource_playctrl.UseDVDSource = True' set the input file_playctrl.SourceFile = inFile' check the DVD optionsDvdInfoCheck()' play it_playctrl.Run()Catch e1 As Exception_result = FalseEnd Try' we'll loop on the state and pump messages for this example.' but you should not need to if running from a Windows Forms application.Do While _playctrl.State = PlayState.RunningApplication.DoEvents()LoopEnd Sub' check DVD properties and infoPrivate Sub DvdInfoCheck()Dim bstrVal As StringDim val As IntegerDim button As Integer = _playctrl.DvdController.CurrentButtonval = _playctrl.DvdController.GetButtonWidth(button)val = _playctrl.DvdController.GetButtonHeight(button)val = _playctrl.DvdController.GetButtonLeft(button)val = _playctrl.DvdController.GetButtonTop(button)val = _playctrl.DvdController.DefaultMenuLanguage_playctrl.DvdController.DefaultMenuLanguage = 1033val = _playctrl.DvdController.GetNumberOfChapters(0)val = _playctrl.DvdController.TotalTitleTimeDim tcFlags As DVDTimecodeFlags = _playctrl.DvdController.TitleTimecodeFlagsval = _playctrl.DvdController.CurrentAngleIf _playctrl.DvdController.AnglesAvailable > 1 Then_playctrl.DvdController.CurrentAngle = 2End IfDim userOp As DVDValidUserOp = _playctrl.DvdController.CurrentUOPSDim audioLang As Long = _playctrl.DvdController.GetAudioLanguage(0)val = _playctrl.DvdController.CurrentAudioStreamIf _playctrl.DvdController.AudioStreamsAvailable > 1 Then_playctrl.DvdController.CurrentAudioStream = 2End Ifval = _playctrl.DvdController.CurrentTimeval = _playctrl.DvdController.CurrentVolumeval = _playctrl.DvdController.VolumesAvailableval = _playctrl.DvdController.TitlesAvailableDim enabled As Boolean = _playctrl.DvdController.IsAudioStreamEnabled(0)val = _playctrl.DvdController.DefaultAudioLanguage_playctrl.DvdController.SelectDefaultAudioLanguage(1033, DVDAudioLangExt.Captions)Dim directory As String = _playctrl.DvdController.DVDDirectoryval = _playctrl.DvdController.CurrentSubpictureStreamval = _playctrl.DvdController.SubpictureStreamsAvailableIf (val > 1) Then_playctrl.DvdController.CurrentSubpictureStream = 1End Ifval = _playctrl.DvdController.DefaultSubpictureLanguage_playctrl.DvdController.SelectDefaultSubpictureLanguage(1033, DVDSubpictureLangExt.Caption_Normal)val = _playctrl.DvdController.CurrentTitleDim subPicLangExt As DVDSubpictureLangExt = _playctrl.DvdController.DefaultSubpictureLanguageExtDim audioLangExt As DVDAudioLangExt = _playctrl.DvdController.DefaultAudioLanguageExtDim subpicLang As Long = _playctrl.DvdController.GetSubpictureLanguage(0)Dim subPicStream As Boolean = _playctrl.DvdController.IsSubpictureStreamEnabled(0)val = _playctrl.DvdController.GetDVDTextLanguageLCID(0)val = _playctrl.DvdController.DVDTextNumberOfLanguagesval = _playctrl.DvdController.GetGPRM(0)_playctrl.DvdController.SetGPRM(0, 1)val = _playctrl.DvdController.GetDVDTextNumberOfStrings(0)val = _playctrl.DvdController.ButtonsAvailableval = _playctrl.DvdController.PlayerParentalLevelval = _playctrl.DvdController.PlayerParentalCountryDim ppCountry As String = String.Format("{0}{1}", CChar(ChrW(val And &HFF)), CChar(ChrW(val >> 8)))If ppCountry <> "US" Thenval = CInt(AscW("U"c))val += (CInt(AscW("S"c)) << 8)_playctrl.DvdController.SelectParentalCountry(val, "user", "pwd")End Ifval = _playctrl.DvdController.GetTitleParentalLevels(-1)_playctrl.DvdController.SelectParentalLevel(9, "user", "pwd")Dim domain As DVDDomain = _playctrl.DvdController.CurrentDomainDim diskSide As DVDDiscSide = _playctrl.DvdController.CurrentDiscSideval = _playctrl.DvdController.CurrentChapterDim textStrType As DVDTextStringType = _playctrl.DvdController.GetDVDTextStringType(0, 0)If (Not _playctrl.DvdController.SubpictureOn) Then_playctrl.DvdController.SubpictureOn = TrueEnd Ifval = _playctrl.DvdController.GetSPRM(0)bstrVal = _playctrl.DvdController.GetDVDTextString(0, 0)bstrVal = _playctrl.DvdController.DVDUniqueIDEnd Sub' menu event helpers for DVD navigation and controlPrivate Sub mnAcceptParentalLevelChange_Click()_playctrl.DvdController.AcceptParentalLevelChange(True)End SubPrivate Sub mnActivateAtPosition_Click()_playctrl.DvdController.ActivateAtPosition(10, 10)End SubPrivate Sub mnActivateButton_Click()_playctrl.DvdController.ActivateButton()End SubPrivate Sub mnChangeDVDRegion_Click()_playctrl.DvdController.ChangeDVDRegion(_form)End SubPrivate Sub mnNotifyParentalLevelChange_Click()_playctrl.DvdController.NotifyParentalLevelChange(True)End SubPrivate Sub mnPause_Click()_playctrl.DvdController.Pause(True)End SubPrivate Sub mnPlayAtInTitle_Click()_playctrl.DvdController.PlayAtTimeInTitle(1, 10000000)End SubPrivate Sub mnPlayAtTime_Click()_playctrl.DvdController.PlayAtTime(10000000)End SubPrivate Sub mnPlaybackword_Click()_playctrl.DvdController.PlayBackwards(5)End SubPrivate Sub mnPlayChapter_Click()_playctrl.DvdController.PlayChapter(1)End SubPrivate Sub mnPlaychapterautostop_Click()_playctrl.DvdController.PlayChaptersAutoStop(1, 2, 5)End SubPrivate Sub mnPlaychapterintitle_Click()_playctrl.DvdController.PlayChapterInTitle(1, 3)End SubPrivate Sub mnPlayfowrward_Click()_playctrl.DvdController.PlayForwards(5)End SubPrivate Sub mnPlayNextChapter_Click()_playctrl.DvdController.PlayNextChapter()End SubPrivate Sub mnPlayperiod_Click()_playctrl.DvdController.PlayPeriodInTitleAutoStop(1, 30, 120)End SubPrivate Sub mnPlayPrevChapter_Click()_playctrl.DvdController.PlayPrevChapter()End SubPrivate Sub mnPlaytitle_Click()_playctrl.DvdController.PlayTitle(1)End SubPrivate Sub mnReplayChapter_Click()_playctrl.DvdController.ReplayChapter()End SubPrivate Sub mnResume_Click()_playctrl.DvdController.Resume()End SubPrivate Sub mnReturnfromsubmenu_Click()_playctrl.DvdController.ReturnFromSubmenu()End SubPrivate Sub mnSelectAndActivateButton_Click()_playctrl.DvdController.SelectAndActivateButton(1)End SubPrivate Sub mnSelectAtPosition_Click()_playctrl.DvdController.SelectAtPosition(10, 10)End SubPrivate Sub mnSelectButton_Click()_playctrl.DvdController.SelectButton(1)End SubPrivate Sub mnSelectRelativeButton_Click()_playctrl.DvdController.SelectRelativeButton(DVDRelativeButton.Right)End SubPrivate Sub mnSetDVDDirectory_Click()_playctrl.DvdController.DVDDirectory = "e:\video_ts"End SubPrivate Sub mnShowMenu_Click()_playctrl.DvdController.ShowMenu(DVDMenuId.Root)End SubPrivate Sub mnStillOff_Click()_playctrl.DvdController.StillOff()End SubPrivate Sub mnStop_Click()_playctrl.DvdController.Stop()End SubPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
