Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
e31ed462
Commit
e31ed462
authored
Jul 27, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc: errorOccurred callback added
parent
d320db7e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
9 deletions
+21
-9
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java
...ain/java/org/videolan/jvlc/event/MediaPlayerCallback.java
+13
-8
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java
...ain/java/org/videolan/jvlc/event/MediaPlayerListener.java
+2
-0
bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java
...e/src/main/java/org/videolan/jvlc/example/VLCExample.java
+5
-0
bindings/java/samples/client/src/main/java/VlcClient.java
bindings/java/samples/client/src/main/java/VlcClient.java
+1
-1
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerCallback.java
View file @
e31ed462
...
...
@@ -41,7 +41,7 @@ public class MediaPlayerCallback implements LibVlcCallback
{
private
MediaPlayerListener
listener
;
private
MediaPlayer
media
Instance
;
private
MediaPlayer
media
Player
;
/**
* Logger.
...
...
@@ -50,7 +50,7 @@ public class MediaPlayerCallback implements LibVlcCallback
public
MediaPlayerCallback
(
MediaPlayer
mediaInstance
,
MediaPlayerListener
listener
)
{
this
.
media
Instance
=
mediaInstance
;
this
.
media
Player
=
mediaInstance
;
this
.
listener
=
listener
;
}
/**
...
...
@@ -60,30 +60,35 @@ public class MediaPlayerCallback implements LibVlcCallback
{
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerPlaying
.
ordinal
())
{
listener
.
playing
(
media
Instance
);
listener
.
playing
(
media
Player
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerPaused
.
ordinal
())
{
listener
.
paused
(
media
Instance
);
listener
.
paused
(
media
Player
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerEndReached
.
ordinal
())
{
listener
.
endReached
(
media
Instance
);
listener
.
endReached
(
media
Player
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerPositionChanged
.
ordinal
())
{
listener
.
positionChanged
(
media
Instance
);
listener
.
positionChanged
(
media
Player
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerStopped
.
ordinal
())
{
listener
.
stopped
(
media
Instance
);
listener
.
stopped
(
media
Player
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerTimeChanged
.
ordinal
())
{
libvlc_event
.
event_type_specific
.
setType
(
LibVlc
.
media_player_time_changed
.
class
);
LibVlc
.
media_player_time_changed
timeChanged
=
(
media_player_time_changed
)
libvlc_event
.
event_type_specific
.
readField
(
"media_player_time_changed"
);
listener
.
timeChanged
(
mediaInstance
,
timeChanged
.
new_time
);
listener
.
timeChanged
(
mediaPlayer
,
timeChanged
.
new_time
);
}
else
if
(
libvlc_event
.
type
==
LibVlcEventType
.
libvlc_MediaPlayerEncounteredError
.
ordinal
())
{
log
.
warn
(
"Media player encountered error."
);
listener
.
errorOccurred
(
mediaPlayer
);
}
else
{
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaPlayerListener.java
View file @
e31ed462
...
...
@@ -43,4 +43,6 @@ public interface MediaPlayerListener
void
positionChanged
(
MediaPlayer
mediaPlayer
);
void
errorOccurred
(
MediaPlayer
mediaPlayer
);
}
bindings/java/core/src/main/java/org/videolan/jvlc/example/VLCExample.java
View file @
e31ed462
...
...
@@ -64,6 +64,11 @@ public class VLCExample
{
System
.
out
.
println
(
"Media player stopped. MRL: "
+
mediaPlayer
.
getMediaDescriptor
().
getMrl
());
}
public
void
errorOccurred
(
MediaPlayer
mediaPlayer
)
{
System
.
out
.
println
(
"An error has occurred."
);
}
});
mediaPlayer
.
play
();
...
...
bindings/java/samples/client/src/main/java/VlcClient.java
View file @
e31ed462
...
...
@@ -5,7 +5,7 @@
*
* Created on 28-feb-2006
*
* $Id:
AudioIntf.java 8 2006-02-28 12:03:47Z little
$
* $Id: $
*
* This program is free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public License
...
...
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