getOffsetInMilliseconds() - showing zero


#1

Hi

I’m creating an audioplayer skill modified from the podcast player tutorial/template.

I’m having an issue with getOffsetInMilliseconds(), which is returning zero after playback is stopped.

Here’s the Alexa handler - which does execute at the correct point, but returns zero.

'AlexaSkill.PlaybackStopped'() {
		console.log('playback stopped. progress = ' + this.$alexaSkill.$audioPlayer.getOffsetInMilliseconds())
		let currentIndex = this.$user.$data.currentIndex;
		this.$user.$data.items[currentIndex].currentProgress = this.$alexaSkill.$audioPlayer.getOffsetInMilliseconds();
	},

Any ideas?


#2

In the end I accessed this information by using:

this.$alexaSkill.$request.request.offsetInMilliseconds

Is there any issue with this approach? And any ideas why getOffsetInMilliseconds() isn’t working for me?

Tom


#3

Hi @tom,

at what point does the handler get invoked?


#4

Hi. It’s invoked when the player is stopped, so that I can keep track of progress.


#5

How do you test it, with an actual device or with the Jovo Debugger?


#6

Hi - thanks for following this up. I was just in the debugger, but once I moved to the device I realised I had an issue with the token - now resolved.

Cheers
Tom


closed #7