如何在html和css代码中预加载我的视频?

时间:2015-06-23 18:28:50

标签: html video

我需要预加载我的视频,因为从加载标签到视频加载时似乎有5-10秒的延迟。如何在此代码中指定视频需要在页面加载时预加载而不是标签加载?

<div class="tab-pane fade" id="tab3">
  <object id="flashObj" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0">
  <param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9?isVid=1&isUI=1" />
  <param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="videoId=3286763175001&linkBaseURL=http%3A%2F%2Fmedianetwork.oracle.com%2Fvideo%2Fplayer%2F3286763175001&playerID=1787102915001&playerKey=AQ~~,AAAAAFcSbzI~,OkyYKKfkn3xPOduPEsqhjskdCvDxqymz&domain=embed&dynamicStreaming=true" />
  <param name="autoplay" value="true" />
  <param name="base" value="http://admin.brightcove.com" />
  <param name="seamlesstabbing" value="false" />
  <param name="allowFullScreen" value="true" />
  <param name="swLiveConnect" value="true" />
  <param name="allowScriptAccess" value="always" />
  <embed src="http://c.brightcove.com/services/viewer/federated_f9?isVid=1&isUI=1" bgcolor="#FFFFFF" flashVars="videoId=3286763175001&linkBaseURL=http%3A%2F%2Fmedianetwork.oracle.com%2Fvideo%2Fplayer%2F3286763175001&playerID=1787102915001&playerKey=AQ~~,AAAAAFcSbzI~,OkyYKKfkn3xPOduPEsqhjskdCvDxqymz&domain=embed&dynamicStreaming=true" base="http://admin.brightcove.com" name="flashObj" width="640" height="358" seamlesstabbing="false" type="application/x-shockwave-flash" allowFullScreen="true" allowScriptAccess="always" swLiveConnect="true" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" style="width: 550px;"></embed>

这个视频中似乎还有很多参数,我可以删除哪些参数,即非必要参数?

1 个答案:

答案 0 :(得分:0)

当您使用Brightcove播放器时,使用他们的智能播放器API可能是最简单的方法。

这包括在播放器加载时告诉您的事件,您可以使用它来立即加载视频。

请看下面链接中的示例,特别是播放器准备好时调用的onTemplateReady调用函数。

满足您需求的回调函数的简化版本:

onTemplateReady = function (evt) {
      //Called when the video player is loaded and ready
      console.log("ready");
      modVP.loadVideoByID(videoID);  //modVP is the video player 'Module'
});