后台传来毫秒,前台转换成对应的时分秒 //在线时长 function longTime(seconds){ //总秒数 //seconds=seconds/1000; //得到小时 var hour = seconds/3600; var r = seconds%3600; var m = r/60; var s = r%60; return parseInt(hour)+":"+parseInt(m)+":"+parseInt(s); }
File source = new File("视频.mp4"); Encoder encoder = new Encoder(); try { MultimediaInfo info = encoder.getInfo(source); System.out.println("dura="+info.getDuration()); Date date = new Date(info.getDuration()); SimpleDateFormat sdf = ne