Skip to main content

Dealing with Chapters

5 replies [Last post]
elbob
Offline
Joined: 2008-10-01

With a PlaybackControl and PlaybackListener I am notified when I reach a new Chapter.

public void markReached(PlaybackMarkEvent playbackMarkEvent) {
int actualChapter = playbackMarkEvent.getMark();
}

I can also skip to Marks with PlaybackControl.

What I can't find is a way to read the actual Chapter. Shouldn't it also be possible with these Controls?

I helped myself reading the PSR:
RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_CHAPTER_NR);

Is that the only way to do it?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
elbob
Offline
Joined: 2008-10-01

I just thought there might be a field or method in one of those controls that could do the same thing. If reading the PSR is the way to go I'm happy with it.

Thanks!

xjc
Offline
Joined: 2009-07-07

I have a stupid question that must be real obvious.

I have the following code to tell me the current chapter.

RegisterAccess.getInstance().getPSR(RegisterAccess.PSR_CHAPTER_NR);

On some players it returns the right chapter number, on other players its way above the number chapters are on the disc, like in the 50,000 range.

What am I doing wrong?

Thanks!

pstarner
Offline
Joined: 2009-02-12

So, what is insufficient with reading the chapter as below? Are you looking to get chapter information whilst in the chapter? I would not know of another method other than from PSR as you are doing it. The playbackMarkEvent is only triggered upon normal playback of video when passing over the chapter mark.

> int actualChapter = playbackMarkEvent.getMark();
>
>

pstarner
Offline
Joined: 2009-02-12

Hi Nasim!

-phil

nasim_hafiz
Offline
Joined: 2009-01-11

The PSR5 represents the current chapter_number value.
markReached Notifies that a mark was reached. This method is not called when playing at a rate different than 1.0.