本文整理汇总了Java中org.videolan.libvlc.IVLCVout.setWindowSize方法的典型用法代码示例。如果您正苦于以下问题:Java IVLCVout.setWindowSize方法的具体用法?Java IVLCVout.setWindowSize怎么用?Java IVLCVout.setWindowSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.libvlc.IVLCVout
的用法示例。
在下文中一共展示了IVLCVout.setWindowSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMedia
import org.videolan.libvlc.IVLCVout; //导入方法依赖的package包/类
private void setMedia(Media media) {
//delay = network buffer + file buffer
//media.addOption(":network-caching=" + Constants.BUFFER);
//media.addOption(":file-caching=" + Constants.BUFFER);
media.addOption(":fullscreen");
media.setHWDecoderEnabled(true, false);
player = new MediaPlayer(vlcInstance);
player.setMedia(media);
player.setEventListener(this);
IVLCVout vlcOut = player.getVLCVout();
//set correct class for render depend of constructor called
if (surfaceView != null) {
vlcOut.setVideoView(surfaceView);
width = surfaceView.getWidth();
height = surfaceView.getHeight();
} else if (textureView != null) {
vlcOut.setVideoView(textureView);
width = textureView.getWidth();
height = textureView.getHeight();
} else if (surfaceTexture != null) {
vlcOut.setVideoSurface(surfaceTexture);
} else if (surface != null) {
vlcOut.setVideoSurface(surface, surfaceHolder);
} else {
throw new RuntimeException("You cant set a null render object");
}
if (width != 0 && height != 0) vlcOut.setWindowSize(width, height);
vlcOut.attachViews();
player.setVideoTrackEnabled(true);
player.play();
}