How to change video (and start playback immediately) in Flowplayer via Javascript?

He should change the video and start playing it regardless of whether the video is loading or playing.

Thanks.

+4
source share
4 answers

You can check javascript api for flowplayer here

In particular, you probably want to check the flowplayer objects 'Clip' and 'Player'

0
source

See the example below, where api is your flowplayer instance and replaceclip is the one you want to run.

var api = flashembed("player", {src:'FlowPlayerDark.swf'}, {config: ...}}); var replaceclip = {'url':'myvideo.mp4', 'autoplay':true}; <button onClick="api.playClip(replaceclip)">Play</button> 
+6
source

See my example on Github https://github.com/Teaonly/android-eye/blob/master/assets/droideye.js

 var initAudioPlayer = function () { // install flowplayer into container // http://flash.flowplayer.org/ $f("player", "flowplayer-3.2.15.swf", { plugins: { controls: { fullscreen: false, height: 30, autoHide: false, play: false, } }, clip: { autoPlay: false, url: "stream/live.mp3", } }); audioPlayer = $f(); }; var newClip = {'url':'stream/live.mp3?id='+audioCount,'autoplay':true}; audioCount ++; audioPlayer.play(newClip); 
+2
source
  $f().play([{url:'yourmovie.flv'}]); 

This way you can dynamically change video in Ajax.

+1
source

Source: https://habr.com/ru/post/1286363/


All Articles