I think I figure it out.It's all about the xml string.
In my case, I use:
CString temp = _T("<invoke name=\"vjs_getProperty\" returntype=\"xml\"><arguments><string>defaultPlaybackRate</string></arguments></invoke>");
CString test = m_flash.CallFunction(temp);
It's report an error.But when I use:
CString temp = _T(R"(<invoke name="vjs_getProperty" returntype="xml"><arguments><string>defaultPlaybackRate</string></arguments></invoke>)");
CString test = m_flash.CallFunction(temp);
or:
CString temp = _T(R"(<invoke name="vjs_getProperty" returntype="xml"><arguments><string>!CDATA[[defaultPlaybackRate]]</string></arguments></invoke>)");
CString test = m_flash.CallFunction(temp);
It's OK.
I think the problem is the flash xml parser.The parser analyzes the string in strange way.By the way, seems <arguments></arguments>
must in same line.
However, There is a new bug, memory leak. In visual studio debug mode,the application can't exit normally.
Fix memory leak bug:
change the code
https://github.com/videojs/video-js-swf/blob/master/src/com/videojs/providers/RTMPVideoProvider.as (line:349)
if(_isPlaying){
_ns.close();
_isPlaying = false;
_hasEnded = true;
_reportEnded = true;
_model.broadcastEvent(new VideoPlaybackEvent(VideoPlaybackEvent.ON_STREAM_CLOSE, {}));
_throughputTimer.stop();
_throughputTimer.reset();
}
REPLACE by
if(_isPlaying){
_ns.close();
_videoReference.attachNetStream(null);
_isPlaying = false;
_hasEnded = true;
_reportEnded = true;
_model.broadcastEvent(new VideoPlaybackEvent(VideoPlaybackEvent.ON_STREAM_CLOSE, {}));
_throughputTimer.stop();
_throughputTimer.reset();
_videoReference.clear();
_nc.close();
}
THEN
complie to .SWF file