private final LibVlcMediaListPlayer instance;
private final JVLC jvlc;
-
+
public MediaListPlayer(JVLC jvlc)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_player_get_fps(instance, exception);
}
+
+ public boolean isPlaying()
+ {
+ libvlc_exception_t exception = new libvlc_exception_t();
+ return libvlc.libvlc_media_player_is_playing(instance, exception) == 1? true : false;
+ }
public void addListener(final MediaPlayerListener listener)
{
void libvlc_media_player_set_position(LibVlcMediaPlayer instance, float position, libvlc_exception_t exception);
+ int libvlc_media_player_is_playing(LibVlcMediaPlayer instance, libvlc_exception_t exception);
+
int libvlc_media_player_will_play(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_media_player_set_rate(LibVlcMediaPlayer instance, float rate, libvlc_exception_t exception);
Assert.assertEquals(0, exception.raised);
}
+ @Test
+ public void mediaPlayerIsPlaying() throws Exception
+ {
+ LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
+ LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
+ Assert.assertEquals(0, libvlc.libvlc_media_player_is_playing(mi, exception));
+ libvlc.libvlc_media_player_play(mi, exception);
+ Assert.assertEquals(0, exception.raised);
+ Thread.sleep(200);
+ Assert.assertEquals(1, libvlc.libvlc_media_player_is_playing(mi, exception));
+ }
+
@Test
public void mediaPlayerPauseBad()
{
*/
VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
+/**
+ * is_playing
+ *
+ * \param p_mi the Media Player
+ * \param p_e an initialized exception pointer
+ * \return 1 if the media player is playing, 0 otherwise
+ */
+VLC_PUBLIC_API int libvlc_media_player_is_playing ( libvlc_media_player_t *, libvlc_exception_t * );
+
/**
* Play
*
vlc_object_release( p_input_thread );
}
+/**************************************************************************
+ * is_playing
+ **************************************************************************/
+int libvlc_media_player_is_playing( libvlc_media_player_t *p_mi,
+ libvlc_exception_t *p_e )
+{
+ input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
+
+ if( !p_input_thread )
+ return 0;
+
+ libvlc_state_t state = libvlc_media_player_get_state( p_mi, p_e );
+
+ vlc_object_release( p_input_thread );
+
+ if( state == libvlc_Playing )
+ {
+ return 1;
+ }
+ return 0;
+}
+
+
/**************************************************************************
* Stop
**************************************************************************/
libvlc_media_player_get_title_count
libvlc_media_player_has_vout
libvlc_media_player_is_seekable
+libvlc_media_player_is_playing
libvlc_media_player_new
libvlc_media_player_new_from_input_thread
libvlc_media_player_new_from_media