Reply
Visitor
NewTargetWeb
Posts: 3
Registered: ‎04-28-2011
0 Kudos

Video random

Hi,
i'm using this player (http://support.brightcove.com/en/docs/player-templates#wideVert) to show a list of videos.
Is there a way to show randomly the first video played each time i load the web page?

Here is the code i'm using
        <object id="flashObj" width="588" height="410" 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="playerID=1547844940001&playerKey=AQ~~,AAAArZYDaKE~,UmcpTmscITxdqna3jlBKIOSALa8yBp4Q&domain=embed&dynamicStreaming=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="playerID=1547844940001&playerKey=AQ~~,AAAArZYDaKE~,UmcpTmscITxdqna3jlBKIOSALa8yBp4Q&domain=embed&dynamicStreaming=true" base="http://admin.brightcove.com" name="flashObj" width="588" height="410" 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"></embed></object>
        <script type="text/javascript">brightcove.createExperiences();</script>
Brightcove Team
BC-Oscar
Posts: 503
Registered: ‎12-11-2008
0 Kudos

Re: Video random

 

  You could use the getMediaColletion() API to get a list of the video ids that are available for selection, use your own routine to select one of those randomly and then call the loadVideo() or cueVideo() API to make it the video in the video display.  loadVideo() will autoplay the content while cueVideo() will only load it