Code: Select all
/* Deprecated use libvlc_media_player_set_drawable() */
void libvlc_video_set_parent( libvlc_instance_t *p_instance, libvlc_drawable_t d,
libvlc_exception_t *p_e )
{
/* set as default for future vout instances */
#ifdef WIN32
vlc_value_t val;
if( sizeof(HWND) > sizeof(libvlc_drawable_t) )
return; /* BOOM! we told you not to use this function! */
val.p_address = (void *)(uintptr_t)d;
var_Set( p_instance->p_libvlc_int, "drawable-hwnd", val );
#else
var_SetInteger( p_instance->p_libvlc_int, "drawable-xid", d );
#endif
libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
if( p_mi )
{
libvlc_media_player_set_drawable( p_mi, d, p_e );
libvlc_media_player_release(p_mi);
}
}
Code: Select all
this.drawable = Native.getComponentID(canvas);
Code: Select all
public void play() {
int drawable = (int) jvlc.getVideoHandle();
libvlc_exception_t exception = new libvlc_exception_t();
if (drawable > 0) {
// IMPORTANT! this is the exact method that EMBEDs the canvas for us
libvlc.libvlc_media_player_set_drawable(instance, drawable, exception);
}
libvlc.libvlc_media_player_play(instance, exception);
}
Code: Select all
public void setJVLC(JVLC jvlc) {
this.jvlc = jvlc;
}
Code: Select all
jvlc = new JVLC(JVLC_PARAMS);
Code: Select all
MediaPlayer.play();
Return to “General VLC media player Troubleshooting”
Users browsing this forum: Google [Bot] and 39 guests