作者:rebot | 分类:模组
Minecraft 版本: 1.21.1
平台: fabric
标签: library
Use the commands
/summon mediaplayer:video
/mediaplayer video
to play video.
Or use
/mediaplayer audio
to play audio.
Use
/mediaplayer clear
stop all video and audio.
Create decoder
var file = new File("<video file path>");
var decoder = VideoDecoder.create(file);
Decode and render frame
decoder.fetch();
bufferSource.getBuffer(VideoRenderType.create(decoder.frame));
/* Rendering code */
Play companion audio from video
Minecraft.getInstance().getSoundManager().play(new AudioInstance(decoder.audio.decode(false), null));
Play independent audio
Minecraft.getInstance().getSoundManager().play(new AudioInstance(new AudioDecoder.decode(false), null));请登录后举报
暂无评论,抢个沙发吧~