我想在特定時間啓動AMP(Azure Media Player)HTML5視頻以顯示視頻的特定內容。設置Azure Media Player的開始時間
什麼是不工作是時候開始。視頻始終從零點開始,然後很好地播放到最後。在js控制檯中沒有有用的通知。
我通過一些實例和文檔閱讀,這是什麼我都試過了,(注意線myPlayer.currentTime(30)):
腳本:
var myPlayer = amp('vid1', { /* Options */
"nativeControlsForTouch": false,
autoplay: false,
controls: true,
width: "640",
height: "400",
poster: ""
},
function() {
myPlayer.src([{
src: "http://amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest",
type: "application/vnd.ms-sstr+xml"
}]);
myPlayer.currentTime(30);
console.log('Good to go!');
this.play(); // if you don't trust autoplay for some reason
// add an event listener
this.addEventListener('ended', function() {
console.log('Finished!');
});
});
HTML
<video id="vid1" class="azuremediaplayer amp-default-skin">
<source src="" type="application/vnd.ms-sstr+xml" />
<p class="amp-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that supports HTML5 video
</p>
</video>
我已經使用下面的源來設置它。 Link to documentation I have used
我給你+1了,因爲我認爲它增加了答案的價值,但我自己回答了這個問題,一直在等待「2天設置自我答案」的限制。乾杯! –