Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Commit

Permalink
added support for onTextData event (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-phillips authored and gkatsev committed Jul 18, 2016
1 parent 6e6e4c1 commit 6d0cc4d
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 81 deletions.
17 changes: 9 additions & 8 deletions src/com/videojs/events/VideoPlaybackEvent.as
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.videojs.events{

import flash.events.Event;

public class VideoPlaybackEvent extends Event{

public static const ON_CUE_POINT:String = "VideoPlaybackEvent.ON_CUE_POINT";
public static const ON_META_DATA:String = "VideoPlaybackEvent.ON_META_DATA";
public static const ON_XMP_DATA:String = "VideoPlaybackEvent.ON_XMP_DATA";
Expand All @@ -22,18 +22,19 @@ package com.videojs.events{
public static const ON_ERROR:String = "VideoPlaybackEvent.ON_ERROR";
public static const ON_UPDATE:String = "VideoPlaybackEvent.ON_UPDATE";
public static const ON_VIDEO_DIMENSION_UPDATE:String = "VideoPlaybackEvent.ON_VIDEO_DIMENSION_UPDATE";

public static const ON_TEXT_DATA:String = "VideoPlaybackEvent.ON_TEXT_DATA";

// a flexible container object for whatever data needs to be attached to any of these events
private var _data:Object;

public function VideoPlaybackEvent(pType:String, pData:Object = null){
super(pType, true, false);
_data = pData;
}

public function get data():Object {
return _data;
}

}
}
}
5 changes: 5 additions & 0 deletions src/com/videojs/providers/HTTPVideoProvider.as
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,11 @@ package com.videojs.providers{
_onmetadadataFired = true;
}

public function onTextData(pTextData:Object):void {
_model.broadcastEvent(new VideoPlaybackEvent(VideoPlaybackEvent.ON_TEXT_DATA, {textData:pTextData}));
_model.broadcastEventExternally(ExternalEventName.ON_TEXT_DATA, pTextData);
}

public function onCuePoint(pInfo:Object):void{
_model.broadcastEvent(new VideoPlaybackEvent(VideoPlaybackEvent.ON_CUE_POINT, {cuepoint:pInfo}));
}
Expand Down
Loading

0 comments on commit 6d0cc4d

Please # to comment.