Using External javascript, control Play, Stop, Pause etc. in f4player

I search lots but i can't get any answer regarding this. I am using f4player to play mp4 video in my HTML/JavaScript file. this player work well. but i want to control play/pause/stop of f4player using JavaScript. please any one can help me.

i use f4player

thanks

Answers


From looking at the source code for F4Player, it would appear that it doesn't offer the ability to control the player via JavaScript.

SWF file can be programmed to allow method invocation from JavaScript by making use of the ExternalInterface.addCallback method. You could quite easily modify the source code of the player to register the required JavaScript hooks:

// Create an instance of the F4Player - ensure you don't pass an initial stream.
var player : Player = new Player(null);

// Register some ExternalInterface callback to allow control from the JavaScript
ExternalInterface.addCallback("play", player.Play);

// Initialize the skin in the usual fashion
skin.initialization(
    player,
    stage.stageWidth
    // ...etc.
);

Having said all this, you may be better served by a more complete video player solution such as the one found in video.js.


Need Your Help

Get notification for changed documents in mongodb

networking mongodb configuration

i'm trying to use mongodb as a network wide configuration storage. This the same app runs on multiple machines on the network, each pulls its configuration from its local mongodb. The

Block without spinning in Java?

java multithreading

Certain methods in Java will block until they can do something, like ServerSocket.accept() and InputStream.read(), but how it does this is not easy for me to find. The closest thing I can think of ...