我有 65 集动画系列,格式为 .mp4 h264,我想将其刻录到蓝光光盘上,我需要以下两个功能:
- 可编程的“跳过介绍”按钮(按下按钮后)将跳过视频的前 40 秒,或在 40 秒后消失。
- 并记住上次观看的剧集,这样我就不会寻找上次电影播放时播放的是哪一集。
你能看一下这个代码吗?
import javax.microedition.lcdui.*; import javax.microedition.media.*; import javax.microedition.media.control.*;
public class SkipIntroButton extends Form implements CommandListener {
private Player player; private Command skipIntroCommand; private Command saveProgressCommand; private long lastPlayedTime;
public SkipIntroButton(Player player) { super("Skip Intro"); this.player = player; skipIntroCommand = new Command("Skip Intro", Command.SCREEN, 1); saveProgressCommand = new Command("Save Progress", Command.SCREEN, 2); addCommand(skipIntroCommand); addCommand(saveProgressCommand); setCommandListener(this); }
public void commandAction(Command c, Displayable d) { if (c == skipIntroCommand) {
// Get the current episode length from metadata
long duration = player.getDuration();
if (duration > 0) {
// Calculate the time to skip to (40 seconds into the episode)
long skipTime = 40000;
if (skipTime > duration) {
skipTime = duration;
}
// Skip to the calculated time
player.setMediaTime(skipTime);
} } else if (c == saveProgressCommand) {
// Save the current playback time as the last played time
lastPlayedTime = player.getMediaTime(); } }
// Method to restore playback to the last played time public void restoreProgress() { player.setMediaTime(lastPlayedTime); }
// Method to hide the form after 40 seconds public void hideAfter40s() { // Use a separate thread to avoid blocking the UI thread new Thread(new Runnable() {
public void run() {
try {
Thread.sleep(40000);
} catch (InterruptedException e) {
// Do nothing
}
// Hide the form
setVisible(false);
} }).start(); } } SkipIntroButton form = new SkipIntroButton(player);
form.hideAfter40s();
form.restoreProgress();
- 我需要 Java ME 还是带有 J2ME 插件的 Intellij?
- 从 .mp4 文件刻录蓝光需要使用 .iso,对吗?如果是这样,我该如何使用 .iso 保存我的程序?