I have 65 episodes of some animated series in .mp4 h264 that I want to burn onto bluray disc, and I need to have those 2 functions:
- programmable “skip intro” button that (after pressing button) will skip the first 40s of the video, or disappear after 40s.
- and remember last-time watched episode, so I won’t be looking for which episode I was playing in previous movie session.
Can you look at this code?
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();
- Do I need Java ME, or Intellij with J2ME plugin?
- Burning blurays from .mp4 files needs to be done with .iso, right? and if so how do I save my program with .iso?