سؤال

So, I am trying to set up video controls on Android, when I now try to seek to 0:10 on my Chromecast using mMediaControl.seek(10,null); it seeks always to 0:00.

However the Logcat shows that the seeking was successfull.

Is this a generall SDK Bug or is it my fault?

هل كانت مفيدة؟

المحلول

The Android Connect SDK uses milliseconds when seeking. So you have the right call. Just convert it.

mMediaControl.seek(10000, null);

Or if you want to keep it in seconds.

float mTimeInSeconds = 10.0;
mMediaControl.seek((long) (mTimeInSeconds * 1000), null);

نصائح أخرى

Shouldn't that be:

mMediaControl.seek(<yourmApiClient>,10000);

GOO doc on RemoteMediaPlayer

seek(GoogleApiClient apiClient, long position)
Seeks to a new position within the current media item.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top