2011-07-17 3 views
0

일부 인터넷 자습서에서 필자는 PHP 및 Flex를 사용하는 FLV 비디오 플레이어에 대한 간단한 서버 클라이언트 응용 프로그램을 만들었습니다. 발생한 문제는 메모장 ++를 사용하여 mxml 파일의 비디오 소스를 변경할 수 없다는 것입니다. Flex를 실행하면 소스가 변경 될 수 있지만이 플레이어를 통해 다른 비디오를 실행하고 싶기 때문에 좋은 생각이 아닙니다. FlexPlayer.mxml 소스에 대해서만 내 응용 프로그램이 작동하므로 다른 비디오 소스에 대해이 mxml 파일을 사용하면 안되기 때문에이 Flex Video Player 구성 요소로 다른 비디오를 실행하는 방법을 제안하십시오.비디오 플레이어 구성 요소에 다른 비디오를 플렉스로드

<s:VideoPlayer id="Player" left="0" top="0" width="493" height="382" chromeColor="#2875DE" 
    color="#000000" skinClass="MySkin" source="Video Source/Coldplay - Clocks.flv"/>  
</s:Application> 

답변

1

올바른지, 플렉스 앱이 컴파일되었으므로이를 사용하여 볼 영화를 정의 할 수 없습니다.

그러나 런타임에 다른 대체 데이터를 응용 프로그램으로 가져 오는 방법을 사용할 수도 있습니다. 메모장이나 다른 텍스트 편집기에서이를 편집 할 수 있기 때문에

예를 들어, 당신은 당신이 그것을 할 때마다 실행하기 전에 HTML에서 매개 변수의 비디오 파일을 지정할 수 있습니다 :이 경우

<?xml version="1.0"?> 
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx" > 

<s:VideoPlayer id="Player" left="0" top="0" width="493" height="382" chromeColor="#2875DE" 
       color="#000000" skinClass="MySkin" source="{this.parameters.videoFile}"/>  

</s:Application> 

을, 당신은 것 Flex 어플리케이션을 flashvar 매개 변수로 호출하는 html에 지정하십시오. HTML 페이지에이를 찾습니다 :

<script type="text/javascript"> 
     // For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection. 
     var swfVersionStr = "10.2.0"; 
     // To use express install, set to playerProductInstall.swf, otherwise the empty string. 
     var xiSwfUrlStr = "playerProductInstall.swf"; 
     var flashvars = {}; 
     flashvars.videoFile = 'Video Source/Coldplay - Clocks.flv'; // specifying video here 
     var params = {}; 
     params.quality = "high"; 
     params.bgcolor = "#ffffff"; 
     params.allowscriptaccess = "sameDomain"; 
     params.allowfullscreen = "true"; 
     var attributes = {}; 
     attributes.id = "scratch"; 
     attributes.name = "scratch"; 
     attributes.align = "middle"; 
     swfobject.embedSWF(
      "scratch.swf", "flashContent", 
      "100%", "100%", 
      swfVersionStr, xiSwfUrlStr, 
      flashvars, params, attributes); 
     // JavaScript enabled so display the flashContent div in case it is not replaced with a swf object. 
     swfobject.createCSS("#flashContent", "display:block;text-align:left;"); 
    </script> 

만들기 감각을?

관련 문제