2012-05-17 3 views
0

사용자가 지금 비디오를 공개하기 전에 내 비디오의 미리보기 시스템을 얻으려고합니다. 데이터베이스에서 여러 파일을 검색하고 그에 따라 비디오를 생성 할 수 있어야합니다. 나는 버튼 다음과 같은 기능 이제변수 전달 JS의 문제, 비디오의 슬라이드 쇼

function startVideo(id,link) { 
    $("#"+id).fadeIn("slow", function() { 
     $f("player", {src: "players/nobranding.swf", wmode: 'opaque'}, 
      { 
       clip: { autoPlay: true }, 
       playlist: ['videos/IMPORTS/'+link,], 
       plugins: { controls: { playlist: true }} 
      } 
     ).ipad(); 
    }); 
} 

<a class="btnGray clickable floatRight" style="position:relative;" onclick="startVideo('<?=$content[ReleaseSystem::contentID]?>','<?=$video['filename']?>');"><?=$lang[109]?></a> 

이 버튼은 링크가 이상한 것입니다 비디오 플레이어로드 내가하려고 할 때 난 내 버튼의 링크를 통과 DONT하지만 때 그것에게 전체 기능 고장을 연결을 보내십시오. 그게 왜 일어날 지 모르겠다.

도 여기에 플레이어 여기

<div id="videoFlyout<?=$content[ReleaseSystem::contentID]?>" class="popUpWrapper" style="display:none;position:absolute;top:10px;left:auto;"> 
    <div class="firstPopupDiv" style="left:center;height:425px;width:620px;"> 
     <div class="popupDivInner" style="display:block;" class="hideSteps"> 
      <div id="<?=$content[ReleaseSystem::contentID]?>"> 
       <center><a id="player" style="display:block; height:365px; width:620px;"></a></center> 
      </div> 
      <a class="btnRed clickable floatRight" style="position:relative;" onclick="closeVideo(<?=$content[ReleaseSystem::contentID]?>);"><?=$lang[109]?></a> 
      <a class="btnGray clickable floatRight" style="position:relative;" onclick="startVideo('<?=$content[ReleaseSystem::contentID]?>','<?=$video['filename']?>');"><?=$lang[109]?></a> 
     </div> 
    </div> 
</div> 

내 html 코드 내 렌더링 HTM입니다

<div id="videoFlyout280" class="popUpWrapper" style="position: absolute; top: 10px; left: auto; display: none;"> 
    <div class="firstPopupDiv" style="left:center;height:425px;width:620px;"> 
     <div class="popupDivInner" style="display:block;"> 
      <div id="280" style=""> 
      <center> 
      <a id="player" style="display:block; height:365px; width:620px;"> 
       <object id="player_api" width="100%" height="100%" type="application/x-shockwave-flash" data="players/nobranding.swf"> 
        <param value="true" name="allowfullscreen"> 
        <param value="always" name="allowscriptaccess"> 
        <param value="high" name="quality"> 
        <param value="false" name="cachebusting"> 
        <param value="#000000" name="bgcolor"> 
        <param value="opaque" name="wmode"> 
        <param value="config={"clip":{"autoPlay":true},"playlist":[{"url":"videos/IMPORTS/video_1011_281_1337198589_VID_20120511_00000.3GP","autoPlay":true}],"plugins":{"controls":{"playlist":true}},"playerId":"player"}" name="flashvars"> 
       </object> 
      </a> 
      </center> 
     </div> 
     <a class="btnRed clickable floatRight" onclick="closeVideo(280);" style="position:relative;">Cancel</a> 
     <a class="btnGray clickable floatRight" onclick="startVideo('280','video_1011_280_1337183112_testCat.mp4');" style="position:relative;">Cancel</a> 
     </div> 
    </div> 
</div> 
<div id="videoFlyout281" class="popUpWrapper" style="position: absolute; top: 10px; left: auto;"> 
    <div class="firstPopupDiv" style="left:center;height:425px;width:620px;"> 
     <div class="popupDivInner" style="display:block;"> 
      <div id="281" style=""> 
      <center> 
       <a id="player" style="display:block; height:365px; width:620px;"> </a> 
      </center> 
      </div> 
      <a class="btnRed clickable floatRight" onclick="closeVideo(281);" style="position:relative;">Cancel</a> 
      <a class="btnGray clickable floatRight" onclick="startVideo('281','video_1011_281_1337198589_VID_20120511_00000.3GP');" style="position:relative;">Cancel</a> 
     </div> 
    </div> 
</div> 
+0

사이드 노트 : 아마도 [PHP short tags] (http://stackoverflow.com/a/200666/633656)를 사용하여 다시 생각해보십시오. 모든 의견도 읽으십시오. ". 더 많은 "해제하면 ..." – Recognizer

답변

0

하드 말할 정확히 오류 메시지 및 렌더링 된 HTML없이 무슨 일이 일어나고 있는지,하지만 하나 튀어 나와있는 것은 startVideo(<?=$video['filename']?>);startVideo('<?=$video['filename']?>');이어야합니다. 문자열을 전달한다는 의미이며 JavaScript가 해석하는 내용을 전역 변수 undefined으로 전달하는 것처럼 보입니다.

이렇게하면 문제가 해결됩니다. 그렇지 않으면 추가 조사를 위해 상기 항목을 게시하십시오.

+0

좋아, 이제 귀하의 충고를 들었습니다. 페이지로드시 마지막 비디오로드 중 하나에로드하는 비디오가 있습니다.로드 버튼을 클릭하면 첫 번째 비디오 만로드됩니다. 슬라이드 흠. 왜냐하면 내가 HTML을 사용하여 임베디드했기 때문에 효과가 있었지만, 플레이어를 닫지 않을 IE에 문제가있어서이 포맷으로 변경해야했습니다. 거기에 더 이상 혼란스럽게 만드는 어떤 오류 메시지가 나타납니다. – MDInzee

+0

사이드 노트로 위와 같이'closeVideo' JS 함수를 사용해야합니다. 해당 HTML을 게시 할 수 있습니까? 즉,보기 소스를 만들 때 HTML을 말할 수 있습니까? – marteljn

+0

닫기 함수가 숫자 또는 문자열을 기대합니까? 당신이 그것을 전달하는 방식으로, JS는 숫자로 해석 할 것입니다, 당신이 시작 함수로했던 것처럼 따옴표 안에 넣지 않으면 말입니다. – marteljn