jibix/map-video
Composer 安装命令:
composer require jibix/map-video
包简介
README 文档
README
A PocketMine-MP library to play videos on maps. You can find an example of how to use this library in a plugin here.
Registration
First you need to register the library. Simply do:
\Jibix\MapVideo\MapVideo::initialize($plugin);
Video loading
Load a video:
VideoManager::getInstance()->loadVideo( Video::id("my_video_name"), "/path/to/video.gif", //Only .gif files are supported at the moment static function (Video $video): void{ //Do something (you could play the video for example) }, static function (int $totalFrames, int $loadedFrames): void{ $percentage = round($loadedFrames / $loadedFrames * 100); //Do something (you could send a progress bar to the player for example, since this is called in the main thread) }, true //Set to false if you don't want to cache the video );
Get a cached video:
VideoManager::getInstance()->getCachedVideo($videoId);
Get all cached videos:
$videos = VideoManager::getInstance()->getCachedVideos();
Video playing
Play a video:
$videoSettings = new VideoPlaySettings( repeat: true, //Automatically restarts when the video ends offHand: false //Set to true if you want to play the video in the off-hand //Ideas for more options? Just make an issue! ); VideoSession::get($player)->play($video, $videoSettings);
Stop a video:
VideoSession::get($player)->stop();
Get the currently playing video:
$video = VideoSession::get($player)->getVideo();
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 17
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-12-06