为什么视频显示器没有显示正确的视频开始时间?对于所有视频,它从30:00开始播放,声音为00:00,并在视频播放时开始递增。
<vg-controls>
<vg-play-pause-button></vg-play-pause-button>
<vg-time-display>{{ currentTime | date:'mm:ss' }}</vg-time-display>
<vg-scrub-bar>
<vg-scrub-bar-current-time></vg-scrub-bar-current-time>
</vg-scrub-bar>
<vg-time-display>{{ totalTime | date:'mm:ss' }}</vg-time-display>
<vg-volume>
<vg-mute-button></vg-mute-button>
<vg-volume-bar></vg-volume-bar>
</vg-volume>
<vg-fullscreen-button></vg-fullscreen-button>
</vg-controls>
在图片中,您可以看到视频为62分钟,但显示的总时间为2分钟,当前时间显示为30分12秒,但仅播放00:12ss。
要实现这一目标的任何建议吗?谢谢
答案 0 :(得分:2)
使用&#39; UTC&#39;过滤
DAO class
static int noOfRecords;
//method to display men products
public List<Product> getMenWatch() throws SQLException {
List<Product> returnedMenWatches = new ArrayList<Product>();
String male = "Male";
Statement myStatement = getConnection();
String query = "SELECT Product_ID, Brand, Product_Name, Gender, Product_Price, Product_Picture_Main, COUNT(Product_ID) AS NoOfRecords "
+ "FROM Products WHERE Gender = '"+male+"'";
rs = myStatement.executeQuery(query);
while (rs.next()){
Product proDetails = new Product();
proDetails.setProductId(rs.getInt("Product_ID"));
proDetails.setBrand(rs.getString("Brand"));
proDetails.setName(rs.getString("Product_Name"));
proDetails.setGender(rs.getString("Gender"));
proDetails.setPrice(rs.getFloat("Product_Price"));
Blob mode1 = rs.getBlob("Product_Picture_Main");
Blob mode2 = (Blob) mode1;
byte[]mode3 = mode2.getBytes(1, (int)mode2.length());
String mode4 = Base64.encode(mode3);
proDetails.setMode4(mode4);
noOfRecords = rs.getInt("NoOfRecords");
returnedMenWatches.add(proDetails);
}
return returnedMenWatches;
}
// method to get number of records returned from the get men watches query
public int getNoOfRecords() {
return noOfRecords;
}
这适用于所有时区。
答案 1 :(得分:1)
Videogular正在使用date filter。
您需要添加时区以及所有内容。
<vg-time-display>{{ currentTime | date:'mm:ss':'+0000' }}</vg-time-display>
答案 2 :(得分:0)
创建一个以可读格式返回时间的函数,并在vg-time-display标签中使用该函数
html
<vg-time-display>{{ getTimeString(currentTime) }}</vg-time-display>
角函数
$scope.getTimeString = function (duration ){
var seconds = Math.floor((duration / 1000) % 60),
minutes = Math.floor((duration / (1000 * 60)) % 60),
hours = Math.floor((duration / (1000 * 60 * 60)) % 24);
hours = (hours < 10) ? "0" + hours : hours;
minutes = (minutes < 10) ? "0" + minutes : minutes;
seconds = (seconds < 10) ? "0" + seconds : seconds;
var timeInString;
if (hours > 0) {
timeInString = hours + ":" + minutes + ":" + seconds;
} else {
timeInString = minutes + ":" + seconds;
}
return timeInString;
}