mirror of
https://github.com/videolan/vlc.git
synced 2025-01-08 16:58:09 +08:00
new failing test for medialistplayer_next
This commit is contained in:
parent
c4b95b5063
commit
38f79bff37
@ -55,6 +55,10 @@ public class MediaListPlayer
|
|||||||
return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1;
|
return jvlc.getLibvlc().libvlc_media_list_player_is_playing(instance, exception) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
public void play()
|
public void play()
|
||||||
{
|
{
|
||||||
libvlc_exception_t exception = new libvlc_exception_t();
|
libvlc_exception_t exception = new libvlc_exception_t();
|
||||||
@ -84,6 +88,12 @@ public class MediaListPlayer
|
|||||||
jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception);
|
jvlc.getLibvlc().libvlc_media_list_player_pause(instance, exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void next()
|
||||||
|
{
|
||||||
|
libvlc_exception_t exception = new libvlc_exception_t();
|
||||||
|
jvlc.getLibvlc().libvlc_media_list_player_next(instance, exception);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Plays the given descriptor and returns only when the player has started to play.
|
* Plays the given descriptor and returns only when the player has started to play.
|
||||||
* @param descriptor The media descriptor to play
|
* @param descriptor The media descriptor to play
|
||||||
|
@ -227,4 +227,33 @@ public class MediaListPlayerTest
|
|||||||
Assert.assertEquals(0, exception.raised);
|
Assert.assertEquals(0, exception.raised);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void mediaListPlayerNextNoItems()
|
||||||
|
{
|
||||||
|
libvlc_exception_t exception = new libvlc_exception_t();
|
||||||
|
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
|
||||||
|
libvlc.libvlc_media_list_player_next(mediaListPlayer, exception);
|
||||||
|
Assert.assertEquals(1, exception.raised);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* fails, see https://trac.videolan.org/vlc/ticket/1535
|
||||||
|
*/
|
||||||
|
// @Test
|
||||||
|
public void mediaListPlayerNext() 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_add_media_descriptor(mediaList, mediaDescriptor, exception);
|
||||||
|
libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
|
||||||
|
libvlc.libvlc_media_list_player_play_item_at_index(mediaListPlayer, 0, exception);
|
||||||
|
Thread.sleep(150);
|
||||||
|
libvlc.libvlc_media_list_player_next(mediaListPlayer, exception);
|
||||||
|
Assert.assertEquals(0, exception.raised);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user