diff --git a/dist/video-js.swf b/dist/video-js.swf index 34ca9dc0..0219603d 100644 Binary files a/dist/video-js.swf and b/dist/video-js.swf differ diff --git a/src/VideoJS.as b/src/VideoJS.as index 5a1766f4..3a8d62b5 100644 --- a/src/VideoJS.as +++ b/src/VideoJS.as @@ -66,9 +66,10 @@ package{ } private function registerExternalMethods():void{ - + ExternalInterface.marshallExceptions = true; try{ ExternalInterface.addCallback("vjs_appendBuffer", onAppendBufferCalled); + ExternalInterface.addCallback("vjs_appendChunkReady", onAppendChunkReadyCalled); ExternalInterface.addCallback("vjs_echo", onEchoCalled); ExternalInterface.addCallback("vjs_endOfStream", onEndOfStreamCalled); ExternalInterface.addCallback("vjs_abort", onAbortCalled); @@ -193,6 +194,12 @@ package{ private function onAppendBufferCalled(base64str:String):void{ var bytes:ByteArray = Base64.decode(base64str); + // write the bytes to the provider + _app.model.appendBuffer(bytes); + } + + private function onAppendChunkReadyCalled(fnName:String):void{ + var bytes:ByteArray = Base64.decode(ExternalInterface.call(fnName)); // write the bytes to the provider _app.model.appendBuffer(bytes);