Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
699dd788
Commit
699dd788
authored
Mar 21, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give the opportunity to play synchronously
parent
f56d5507
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
1 deletion
+65
-1
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
...core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
+65
-1
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
View file @
699dd788
...
...
@@ -59,6 +59,17 @@ public class MediaListPlayer
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
jvlc
.
getLibvlc
().
libvlc_media_list_player_play
(
instance
,
exception
);
try
{
while
(
jvlc
.
getLibvlc
().
libvlc_media_list_player_is_playing
(
instance
,
exception
)
==
0
)
{
Thread
.
sleep
(
25
);
}
}
catch
(
InterruptedException
e
)
{
//
}
}
public
void
stop
()
...
...
@@ -73,17 +84,70 @@ public class MediaListPlayer
jvlc
.
getLibvlc
().
libvlc_media_list_player_pause
(
instance
,
exception
);
}
/**
* Plays the given descriptor and returns only when the player has started to play.
* @param descriptor The media descriptor to play
*/
public
void
playItem
(
MediaDescriptor
descriptor
)
{
playItem
(
descriptor
,
true
);
}
/**
* @param descriptor The media descriptor to play
* @param synchronous If true it does not return until the player is not playing.
*/
public
void
playItem
(
MediaDescriptor
descriptor
,
boolean
synchronous
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
jvlc
.
getLibvlc
().
libvlc_media_list_player_play_item
(
instance
,
descriptor
.
getInstance
(),
exception
);
if
(!
synchronous
)
{
return
;
}
try
{
while
(
jvlc
.
getLibvlc
().
libvlc_media_list_player_is_playing
(
instance
,
exception
)
==
0
)
{
Thread
.
sleep
(
25
);
}
}
catch
(
InterruptedException
e
)
{
//
}
}
/**
* Plays the item at the given index and returns only when the player has started to play.
* @param index The item index to play.
*/
public
void
playItem
(
int
index
)
{
playItem
(
index
,
true
);
}
/**
* @param index The item index to play.
* @param synchronous If true it does not return until the player is not playing.
*/
public
void
playItem
(
int
index
,
boolean
synchronous
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
jvlc
.
getLibvlc
().
libvlc_media_list_player_play_item_at_index
(
instance
,
index
,
exception
);
try
{
while
(
jvlc
.
getLibvlc
().
libvlc_media_list_player_is_playing
(
instance
,
exception
)
==
0
)
{
Thread
.
sleep
(
25
);
}
}
catch
(
InterruptedException
e
)
{
//
}
}
public
void
setMediaInstance
(
MediaInstance
mediaInstance
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment