2010-01-29 2 views
0

간단한 플래시 비디오를 재생하기 위해 간단한 사이트를 만들었습니다. 비디오 및 관련 주석에 대한 정보가 xml 파일에 저장되어 있습니다. SimpleXML을 사용하여이 모든 작업을 반복하고 역순으로 물건을 표시합니다. IE8, Safari 및 Chrome에서는 모든 것이 완벽하게 작동하지만 Firefox에서는 동일한 비디오 (simpleXML 배열의 [0]에있는 비디오)가 화면의 모든 비디오에 표시됩니다. 관련된 모든 정보 (제목, 설명 등)는 정확하며 html 출력을 보면 FLV Player가 올바른 파일을 호출하고 있다는 것을 보여줍니다 ... 그러나 Firefox는 표시하지 않습니다!PHP를 사용하여 xml 파일에서 .flv 비디오를 호출 할 때 Firefox 전용 버그

그래서 : PHP 스크립트에서 계정 할 수있는 Firefox DOM에 몇 가지 단점이 있습니까? 내가 무엇을 할 수 있을지? http://omega.uta.edu/~ktb7964/

그리고 당신을 위해 일부 소스 코드 : 페이지는 여기 PHP의 루프 :

<?php 
//this script uses a few for loops to first count the number of video/comment entries in the related xml file, 
//and then count backwards through them so they are all displayed in reverse chronological order. 
//$v is the array position for a video element and $c is the array position for a comment element. 
for($v=0; $xml->video[$v];$v++) {} 
$v--; 
for($v; $v >= 0;$v--) { 
    //the code that declares the FLV player needs to be split into pieces so we can concatenate them with $v. 
    $script1 = file_get_contents('script1.htm'); 
    $script2 = file_get_contents('script2.htm'); 
    $script3 = file_get_contents('script3.htm'); 
    $script4 = file_get_contents('script4.htm'); 
    echo("<h2>" . $xml->video[$v]->title . "</h2>"); 
    echo($script1 . $v . $script2 . $xml->video[$v]->file . $script3 . $xml->video[$v]->url . $script4); 
    echo("<h3>Comments:</h3>"); 
    echo("<form action=\"post".$v.".php\" method=\"post\" name=\"postcomment".$v."\">"); 
    echo("<input name=\"position\" type=\"hidden\" value=\"".$v."\" />"); 
    echo("<input name=\"username\" type=\"text\" size=\"30\" maxlength=\"20\" value =\"Username:\" onblur=\"if(this.value=='') this.value='Username:';\" onfocus= \"this.value='';\" /></p>"); 
    echo("<p><textarea name=\"text\" cols=\"50\" rows=\"5\"></textarea></p>"); 
    echo("<input name=\"submit\" type=\"submit\" value=\"Post a Comment\" />"); 
    echo("</form>"); 
    for($c=0; $xml->video[$v]->comments->comment[$c];$c++) {} 
    $c--; 
    if($c < 0){ 
     echo("<p><i>No comments yet.</i></p>");} 
     else { 
    for($c; $c >= 0; $c--) { 
     echo("<h4>" . $xml->video[$v]->comments->comment[$c]->poster . " said: </h4>"); 
     echo("<p>" . $xml->video[$v]->comments->comment[$c]->post . "</p>"); 
     echo("<hr />"); } 

    } 
    } 
?> 

그리고 XML 파일의 한 부분 :

<videos> 
    <video> 
     <uid>0</uid> 
     <title>The Real World: UTA</title> 
     <file>draft</file> 
     <comments> 
      <comment> 
       <poster>Fooman</poster> 
       <email>[email protected]</email> 
       <post>"This video is so exciting!</post> 
      </comment> 
      <comment> 
       <poster>Foogirl</poster> 
       <email>[email protected]</email> 
       <post>"Ha! That was hilarious!"</post> 
      </comment> 
     </comments> 
    </video> 
</videos> 

감사합니다!

답변

0

먼저 무엇보다도 과 같은 object 태그의 ID 속성에 공백이 있습니다. 구분 기호가 밑줄이나 하이픈을 사용해야하는 경우에는 ID가 연속적인 문자열이어야합니다.

나는 가능한 한 많은 것을 검증하려고 노력할 것이다. 여기 경고 중 일부는 플래시 및 크로스 브라우저 지원으로 인해 피할 수 없게 될 것이므로 사용자는 이러한 문제를 해결해야하지만 플래시가 아닌 부분은 정상적으로 작동해야합니다.

http://validator.w3.org/check?uri=http%3A%2F%2Fomega.uta.edu%2F~ktb7964&charset=%28detect+automatically%29&doctype=Inline&group=0

+0

나는 당신 WAMP 서버에 언급 된 것들 중 몇 가지를 정리하지만 문제가 지속. @prodigitalson : 코드 블록을 추가해 주셔서 감사합니다. 제출할 때까지 버튼을 찾지 못했습니다! – Keith

관련 문제