Ticket #1083: m4a_player_preview.patch

File m4a_player_preview.patch, 8.6 KB (added by ntm, 2 years ago)
  • podpress.css

     
    7979        clear:left; 
    8080} 
    8181 
     82.podPress_videoplayer_wrapper:hover { 
     83        cursor:pointer; 
     84} 
     85 
    8286/* Navi 
    8387************************************************/ 
    8488 
  • podpress.js

     
    3333                refPlayerDiv.innerHTML = podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg); 
    3434        } 
    3535 
     36        function podPressGenerateM4APreview(strPlayerDiv, strMediaFile, numWidth, numHeight, bPreviewOnly) { 
     37                if (typeof numWidth == 'undefined') { numWidth = 320; } 
     38                if (typeof numHeight == 'undefined') { numHeight = 25; } // height of the browser plugin (height of the real player bar) 
     39                var numHeight_middle = 3; // height of the middle row of the player preview 
     40                if (typeof bPreviewOnly == 'undefined') { bPreviewOnly = false; } 
     41 
     42                if(!bPreviewOnly) { 
     43                        var strOnclick= ' onclick="javascript:podPressShowHidePlayer('+strPlayerDiv+', \''+strMediaFile+'\', '+numWidth+', '+numHeight+', \'force\'); return false;"'; 
     44                } else { 
     45                        var strOnclick= ''; // for a preview of this preview player at the player settings page on the admin pages (for the future) 
     46                }                        
     47 
     48                var strResult = ''; 
     49                strResult += '<div class="podPress_videoplayer_wrapper" style="width: '+(numWidth+14)+'px; padding:0px; margin:0px; display:block; background-color:#ff0000;"'+strOnclick+'>'; 
     50                strResult += '  <div class="podPress_videoplayer_toprow" style="width:100%; padding:0px; margin:0px;">'; 
     51                strResult += '          <img src="'+podPressBackendURL+'images/vpreview_top_left.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="."/>'; 
     52                strResult += '          <span style="height:27px; border:0px; display:block; float:left; padding:0px; margin:0px; width: '+numWidth+'px; text-align:center; background:url(\''+podPressBackendURL+'images/vpreview_top_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_top_middle.png" style="width:119px; height:27px padding:0px; margin:0px; border:0px;" alt="." /></span>'; 
     53                strResult += '          <img src="'+podPressBackendURL+'images/vpreview_top_right.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="." />'; 
     54                strResult += '  </div>'; 
     55         
     56                strResult += '  <div class="podPress_videoplayer_middlerow" style="width:100%; padding:0px; margin:0px;">'; 
     57                strResult += '          <span style="width:7px; height:'+numHeight_middle+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_left_background.png\'); background-repeat:repeat-y;"></span>'; 
     58                strResult += '          <span style="width:'+numWidth+'px; height:'+numHeight_middle+'px; padding:0px; margin:0px; border:0px; float:left; background-color:rgb(225,225,225); display:block;" id="podPress_previewImageIMG_'+strPlayerDiv+'"'+strOnclick+'></span>'; 
     59                strResult += '          <span style="width:7px; height:'+numHeight_middle+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_right_background.png\'); background-repeat:repeat-y;"></span>'; 
     60                strResult += '  </div>'; 
     61                 
     62                strResult += '  <div class="podPress_videoplayer_bottomrow" style="width:100%; padding:0px; margin:0px;">'; 
     63                strResult += '          <img src="'+podPressBackendURL+'images/vpreview_bottom_left.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 
     64                strResult += '          <span style="display:block; float:left; padding:0px; margin:0px; text-align: left; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_left.png" style="width:56px; height:23px" alt="." /></span>'; 
     65                strResult += '          <span style="height:23px; display:block; float:left; padding:0px; margin:0px; width:'+String(Math.abs(numWidth-112))+'px; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"></span>'; 
     66                strResult += '          <span style="display:block; float:left; padding:0px; margin:0px; text-align:right; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_right.png" style="width:56px; height:23px" alt="." /></span>'; 
     67                strResult += '          <img src="'+podPressBackendURL+'images/vpreview_bottom_right.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 
     68                strResult += '  </div>'; 
     69                strResult += '</div>'; 
     70                return String(strResult); 
     71        } 
     72         
    3673        function podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg, bPreviewOnly, forEditor) { 
    37                 if (typeof numWidth == 'undefined') { 
    38                         numWidth = 320; 
    39                 } 
    40                 if (typeof numHeight == 'undefined') { 
    41                         numHeight = 240; 
    42                 } 
    43                 if (typeof strPreviewImg == 'undefined') { 
    44                         strPreviewImg = podPressDefaultPreviewImage; 
    45                 } 
    46                 if (typeof bPreviewOnly == 'undefined') { 
    47                         bPreviewOnly = false; 
    48                 } 
     74                if (typeof numWidth == 'undefined') { numWidth = 320; } 
     75                if (typeof numHeight == 'undefined') { numHeight = 240; } 
     76                if (typeof strPreviewImg == 'undefined') { strPreviewImg = podPressDefaultPreviewImage; } 
     77                if (typeof bPreviewOnly == 'undefined') { bPreviewOnly = false; } 
    4978 
    5079                if(numHeight < 80) { 
    5180                        strPreviewImg = podPressBackendURL+'images/vpreview_center_text.png'; 
     
    6796                        strResult += '          <img src="'+podPressBackendURL+'images/vpreview_top_right.png" style="width:7px; height:27px; float:left; padding:0px; margin:0px;" alt="." />'; 
    6897                        strResult += '  </div>'; 
    6998                         
    70                         strResult += '  <div class="podPress_videoplayer_middlerow" style="width:100%; padding:0px; margin:0px; background-color:#ffff00;">'; 
     99                        strResult += '  <div class="podPress_videoplayer_middlerow" style="width:100%; padding:0px; margin:0px;">'; 
    71100                        strResult += '          <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_left_background.png\'); background-repeat:repeat-y;"></span>'; 
    72101                        strResult += '          <img class="#podPress_previewImage" src="'+strPreviewImg+'" style="width:'+numWidth+'px; height:'+numHeight+'px; padding:0px; margin:0px; border:0px; float:left;" alt="previewImg"  id="podPress_previewImageIMG_'+strPlayerDiv+'"'; 
    73102                        if(!bPreviewOnly) { 
     
    77106                        strResult += '          <span style="width:7px; height:'+numHeight+'px; padding:0px; margin:0px; display:block; float:left; background:url(\''+podPressBackendURL+'images/vpreview_right_background.png\'); background-repeat:repeat-y;"></span>'; 
    78107                        strResult += '  </div>'; 
    79108                         
    80                         strResult += '  <div class="podPress_videoplayer_bottomrow" style="width:100%; padding:0px; margin:0px; background-color:#ff00ff;">'; 
     109                        strResult += '  <div class="podPress_videoplayer_bottomrow" style="width:100%; padding:0px; margin:0px;">'; 
    81110                        strResult += '          <img src="'+podPressBackendURL+'images/vpreview_bottom_left.png" style="width:7px; height:23px; float:left; padding:0px; margin:0px;" alt="." />'; 
    82111                        strResult += '          <span style="display:block; float:left; padding:0px; margin:0px; text-align: left; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"><img src="'+podPressBackendURL+'images/vpreview_bottom_middle_left.png" style="width:56px; height:23px" alt="." /></span>'; 
    83112                        strResult += '          <span style="height:23px; display:block; float:left; padding:0px; margin:0px; width:'+String(Math.abs(numWidth-112))+'px; background:url(\''+podPressBackendURL+'images/vpreview_bottom_background.png\'); background-repeat: repeat-x;"></span>'; 
     
    143172                        var strExt = ''; 
    144173                } 
    145174                strExt = strExt.toLowerCase(); 
    146  
    147                 if(strExt != 'mp3' && strExt != 'flv' && strExt != 'yyoutube' && strAutoStart == 'false') { 
     175                 
     176                if(strExt != 'mp3' && strExt != 'flv' && strExt != 'youtube' && strAutoStart == 'false') { 
    148177                        if(strExt == 'youtube') { 
    149178                                strMediaFile = strMediaFile+'.youtube'; 
    150179                        } 
    151                         return podPressGenerateVideoPreview (strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg); 
     180                        if (strExt == 'm4a') { 
     181                                return podPressGenerateM4APreview(strPlayerDiv, strMediaFile, numWidth, 25); 
     182                        } else { 
     183                                return podPressGenerateVideoPreview(strPlayerDiv, strMediaFile, numWidth, numHeight, strPreviewImg); 
     184                        } 
    152185                } 
     186                 
     187                var strResult = ''; 
    153188                switch (strExt) { 
    154189                        case 'm4v': 
    155190                        case 'm4a':