0

I have several videos autoplaying on a webpage using Flowplayer and jQuery like so:

$('.video').each(function (k, obj) {
  $(obj).flowplayer(...)
})

They're streaming videos and start playing automatically.

Later I want to use the Javascript API to interact with the player. It's not working, despite $f() returning a Flowplayer object:

$f('video1') // -> {_api: function ...}

I just learned that you must 'load' the player first, but that doesn't help:

$f('video1').isLoaded() // -> false
$f('video1').load(function () { console.log('video loaded') })
$f('video1').isLoaded() // -> false

The bizarre thing is that when I call load() the video flashes to black and then starts playing again, but the load callback function doesn't fire.

Why is this?

pr1001
  • 21,727
  • 17
  • 79
  • 125

1 Answers1

0

Check your arguments. The load() api method is as follows:

load([video],[callback])

try something like this:

load('path_to_your_video', function(){ ...

Hope that fixed it!

wheresmycookie
  • 683
  • 3
  • 16
  • 39