Listen to my Flash event in Javascript

I am trying to create a basic video player with a playlist using OVP Player. So far I have figured out how to feed a new video source using ExternalInterface, but I cannot figure out how to listen to the Flash event "EVENT_END_OF_ITEM".

How to listen for Flash events in Javascript (and therefore jQuery)?

There are many events defined in OVP, but I donโ€™t know how to listen to them. For example, here is EVENT_END_OF_ITEM:

public function endOfItem():void {
     sendEvent(EVENT_END_OF_ITEM);
}

OVP documentation is missing and their support forum is almost as bad.

+3
source share
3 answers

In the Model.as file, find this line with all the other importers (at the beginning of the file):

import flash.external.*;

:

ExternalInterface.call("stopedPlaying");

:

        public function endOfItem():void {
            sendEvent(EVENT_END_OF_ITEM);
            // inform JavaScript that the FLV has stopped playing
            ExternalInterface.call("stoppedPlaying");
        }

HTML SCRIPT:

function stoppedPlaying()
{
    // do something when the FLV starts playing
};
+4

, externalInterface jQuery . , DOMEx , . DOMEx:

if (ExternalInterface.available) ExternalInterface.call(javaScript, "Howdy Ya'll");
[...]
+1

SWF google
http://code.google.com/p/swfobject/

ActionScript javascript

0

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


All Articles