+
+ @Test
+ public void mediaListPlayerIsPlaying() throws Exception
+ {
+ libvlc_exception_t exception = new libvlc_exception_t();
+ LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
+ LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
+ LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
+ libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
+ libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
+ libvlc.libvlc_media_list_player_play_item(mediaListPlayer, mediaDescriptor, exception);
+
+ while (true)
+ {
+ int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception);
+ Assert.assertEquals(0, exception.raised);
+ if (playing == 1)
+ {
+ break;
+ }
+ Thread.sleep(150);
+ }
+ Assert.assertEquals("Expected state: " + LibVlcState.libvlc_Playing +".\n", LibVlcState.libvlc_Playing.ordinal(), libvlc.libvlc_media_list_player_get_state(
+ mediaListPlayer,
+ exception));
+
+ libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception);
+ while (true)
+ {
+ int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception);
+ Assert.assertEquals(0, exception.raised);
+ if (playing == 0)
+ {
+ break;
+ }
+ Thread.sleep(150);
+ }
+ Assert.assertEquals(LibVlcState.libvlc_Stopped.ordinal(), libvlc.libvlc_media_list_player_get_state(
+ mediaListPlayer,
+ exception));
+ }
+
+