Closed KnIfER closed 6 years ago
temporary:
MediaMetadataRetriever retr = new MediaMetadataRetriever();
retr.setDataSource(mMediaPlayer.getMedia().getUri().getPath());
height = Integer.valueOf(retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_HEIGHT)); // 视频高度
width = Integer.valueOf(retr.extractMetadata(MediaMetadataRetriever.METADATA_KEY_VIDEO_WIDTH) ) ; // 视频宽度
I've asked vlc team about it, take a look - https://code.videolan.org/videolan/vlc-android/issues/523. You need to add option "--vout=android-display".
Thank you!It's working now.
what's more,I found that the on-start greenish display has vanished.
and that the seek behaviour looks more fluent.
so it must be an important option to add for vlc-android!
ArrayList<String> options = new ArrayList(1);
options.add("--vout=android-display");
mLibVLC = new LibVLC(this,options);
in earlier version,onNewLayout works fine.
but in the new onNewVideoLayout listener
onNewVideoLayout(IVLCVout vlcVout, int width, int height, int visibleWidth, int visibleHeight, int sarNum, int sarDen)
width is always 10,height 0,visibleHeight 0,visibleWidth 0.thus I cannot handle the scaling of a videoview by this callback