FMS 4.5 (FMS 5에서도 사용됨)로 HLS를 구현할 때 문제가 있습니다. 나는이 기사 http://help.adobe.com/en_US/flashmediaserver/devguide/WSd391de4d9c7bd6 09-52e437a812a3725dfa0-8000.html을 따르고있다.FMS 및 Flex와 함께 HLS (HTTP 라이브 스트리밍)을 구현하는 문제 4.7
FMLE (플래시 미디어 라이브 인코더)를 사용하여 livepkgr 어플리케이션에 라이브 스트림을 게시 할 때. 그것은 내 장치에 잘 작동합니다. 그러나 Flex 4.7 코드를 사용하여 게시 할 때 소리가 나지 않으며 ios 장치에서 비디오 재생이 얼마간 멈추게됩니다.
누구나 이런 일이 일어나는 이유를 알 수 있습니다. 어떤 도움을 주시면 감사하겠습니다.
검토 할 코드를 추가하고 있습니다. (당신은 creation_complete 이벤트 호출 "windowedapplication1_creationCompleteHandler"에 플렉스 프로젝트를 만듭니다. 그리고 FMS를 서버 IP를 reall하는 FMS_serverIp을 변경할 수 있습니다.
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
import mx.events.FlexEvent;
var nc:NetConnection;
var cam:Camera;
protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void{
var ui:UIComponent = new UIComponent();
var v:Video = new Video();
ui.addChild(v);
this.addElement(ui);
this.cam = Camera.getCamera();
this.cam.setMode(320, 240, 30);
this.cam.setQuality(0, 100);
v.attachCamera(this.cam);
this.nc = new NetConnection();
this.nc.client = this;
this.nc.addEventListener(NetStatusEvent.NET_STATUS, startStream);
this.nc.connect("rtmp://FMS_serverIp/livepkgr/");
}
protected function startStream(event:NetStatusEvent):void
{
switch (event.info.code){
case "NetConnection.Connect.Success":
trace("init stream "+this.nc.uri);
var s:NetStream = new NetStream(this.nc);
var h264Settings:H264VideoStreamSettings;s
h264Settings = new H264VideoStreamSettings();
h264Settings.setProfileLevel(H264Profile.MAIN, H264Level.LEVEL_1_2);
h264Settings.setMode(320,240,30);
s.videoStreamSettings = h264Settings;
s.client = this;
s.addEventListener(NetStatusEvent.NET_STATUS, checkMediaStatus);
s.attachCamera(this.cam);
s.attachAudio(Microphone.getMicrophone());
s.publish("livestream?adbe-live-event=liveevent");
trace("Stream is publishing ...");
break;
}
}
protected function checkMediaStatus(event:NetStatusEvent):void
{
trace("Stream status "+event.info.code);
}
]]>
</fx:Script>