Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Video playlist not incrementing!

$
0
0
Both local variables mt & md are of float data-type. It means they possibly have a fractional part which isn't zero!
Rather than use the imprecise float, try the safer int out:

final Movie myFilm = myMovies[myMoviesIndex];

final int mt = round( myFilm.time() );
final int md = round( myFilm.duration() );

if (mt == md) {
  myFilm.pause();
  println("Done! Next coming up...");
  if (++myMoviesIndex == maxMovies)   myMoviesIndex = 0;
}



Viewing all articles
Browse latest Browse all 1768

Trending Articles