Хак Обновление ДЛЕ 7.3 Видео и Аудио плеера, фикс проблемы buffering

Тема в разделе "DLE", создана пользователем ORZ, 21 янв 2009.

Информация :
Актуальная версия DataLife Engine 12.0
( Final Release v.12.0 | Скачать DataLife Engine | Скачать 12.0 demo )
Нужно ли обновляться | Как обновиться | Изменения в шаблонах
> Нет русских символов <
[Приватная тема DLE (Все подробности в ЛС к модератору раздела)]

Версии 11.3 и ниже - уязвимы!

Локализации | F.A.Q. | Внешний вид
Правила раздела | Правила форума
Обсуждение хайда карается баном!
В каждом сообщении указывайте версию DLE, которого они касаются!
Статус темы:
Закрыта.
Модераторы: killoff
  1. ORZ

    ORZ

    Регистр.:
    13 июн 2007
    Сообщения:
    255
    Симпатии:
    80
    Откриваем engine/classes/parse.class.php

    Исчем

    Код:
    	function build_video ( $url )
    	{
    		global $config;
    
    		$option = explode("|", trim($url));
    
    		$url = $this->clear_url( urldecode( $option[0] ) );
    
    		$type = explode(".", $url);
    		$type = strtolower(end($type));
    
    		if ( preg_match( "/[?&;%<\[\]]/", $url) ) {
    
    			 return "[video=".$url."]";
    
    		}
    
    		if ($option[1] != "") {
    
    			$option[1] = htmlspecialchars(strip_tags(stripslashes($option[1])), ENT_QUOTES);
    			$decode_url = $url."|".$option[1];
    
    		} else $decode_url = $url;
    
    		if ($type == "flv" OR $type == "mp4" OR $type == "m4v" OR $type == "m4a") {
    
    			if ($config['flv_watermark']) $watermark = ",showWatermark:'always',watermarkUrl:'{THEME}/dleimages/flv_watermark.png',watermarkLinkUrl:''"; else $watermark = "";
    
    		return "<!--dle_video_begin:{$decode_url}--><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"425\" height=\"325\">
    				<param name=\"movie\" value=\"".$config['http_home_url']."engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{overlayId:'play',url:'{$option[1]}'},{start:0,url:'{$url}?source=1'}],initialScale:'fit',showMenu:false,controlBarGloss:'low',controlBarBackgroundColor:-1,controlsOverVideo:'ease',startingBufferLength:1,showOnLoadBegin:true,loop:false,autoRewind:true,autoBuffering:true,autoPlay:false{$watermark}}\" />
    				<param name=\"allowFullScreen\" value=\"true\" />
    				<param name=\"quality\" value=\"high\" />
    				<param name=\"bgcolor\" value=\"#000000\" />
    				<param name=\"wmode\" value=\"transparent\" />
    				<embed src=\"".$config['http_home_url']."engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{overlayId:'play',url:'{$option[1]}'},{start:0,url:'{$url}?source=1'}],initialScale:'fit',showMenu:false,controlBarGloss:'low',controlBarBackgroundColor:-1,controlsOverVideo:'ease',startingBufferLength:1,showOnLoadBegin:true,loop:false,autoRewind:true,autoBuffering:true,autoPlay:false{$watermark}}\" quality=\"high\" bgcolor=\"#000000\" wmode=\"transparent\" allowFullScreen=\"true\" width=\"425\" height=\"325\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
    				</object><!--dle_video_end-->";
    
    		} elseif($type == "avi" OR $type == "divx") {
    
    		return "<!--dle_video_begin:{$decode_url}--><object classid=\"clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616\" width=\"425\" height=\"341\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\">
    				<param name=\"custommode\" value=\"none\" />
    				<param name=\"mode\" value=\"zero\" />
    				<param name=\"autoPlay\" value=\"false\" />
    				<param name=\"src\" value=\"{$url}\" />
    				<param name=\"previewImage\" value=\"{$option[1]}\" />
    				<embed type=\"video/divx\" src=\"{$url}\" custommode=\"none\" width=\"425\" height=\"341\" mode=\"zero\"  autoPlay=\"false\" previewImage=\"{$option[1]}\" pluginspage=\"http://go.divx.com/plugin/download/\">
    				</embed>
    				</object><!--dle_video_end-->";
    
    		} else {
    
    
    		return "<!--dle_video_begin:{$url}--><object id=\"mediaPlayer\" width=\"380\" height=\"310\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">
    				<param name=\"url\" VALUE=\"{$url}\" />
    				<param name=\"autoStart\" VALUE=\"false\" />
    				<param name=\"showControls\" VALUE=\"true\" />
    				<param name=\"TransparentatStart\" VALUE=\"false\" />
    				<param name=\"AnimationatStart\" VALUE=\"true\" />
    				<param name=\"StretchToFit\" VALUE=\"true\" />
    				<embed pluginspage=\"http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/\" src=\"{$url}\" width=\"380\" height=\"310\" type=\"application/x-mplayer2\" autorewind=\"1\" showstatusbar=\"1\" showcontrols=\"1\" autostart=\"0\" allowchangedisplaysize=\"1\" volume=\"70\" stretchtofit=\"1\" />
    				</object><!--dle_video_end-->";
    		}
    
    	}
    	function build_audio ( $url )
    	{
    		global $config;
    		$url = $this->clear_url( urldecode( $url ) );
    
    		if ($url == "" ) return;
    
    		if ( preg_match( "/[?&;%<\[\]]/", $url) ) {
    
    			 return "[audio=".$url."]";
    		}
    
    		$txt = explode('/', $url);
    		$txt = strtolower(end($txt));
    
    
    		return "<!--dle_audio_begin:{$url}--><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"275\" height=\"50\">
    				<param name=\"movie\" value=\"".$config['http_home_url']."engine/classes/flashplayer/mp3.swf?mp3url={$url}&txt={$txt}&bgcolor=#ffffff\" />
    				<param name=\"allowFullScreen\" value=\"true\" />
    				<param name=\"quality\" value=\"high\" />
    				<param name=\"bgcolor\" value=\"#ffffff\" />
    				<param name=\"wmode\" value=\"opaque\" />
    				<embed src=\"".$config['http_home_url']."engine/classes/flashplayer/mp3.swf?mp3url={$url}&txt={$txt}&bgcolor=#ffffff\" quality=\"high\" bgcolor=\"#ffffff\" wmode=\"opaque\" width=\"275\" height=\"50\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
    				</object><!--dle_audio_end-->";
    
    
    	}
    Замениаем на

    Код:
    	function build_video($url) {
    		global $config;
    		
    		$option = explode( "|", trim( $url ) );
    		
    		$url = $this->clear_url( urldecode( $option[0] ) );
    		
    		$type = explode( ".", $url );
    		$type = strtolower( end( $type ) );
    		
    		if( preg_match( "/[?&;%<\[\]]/", $url ) ) {
    			
    			return "[video=" . $url . "]";
    		
    		}
    		
    		if( $option[1] != "" ) {
    			
    			$option[1] = htmlspecialchars( strip_tags( stripslashes( $option[1] ) ), ENT_QUOTES );
    			$decode_url = $url . "|" . $option[1];
    		
    		} else
    			$decode_url = $url;
    		
    		if( $type == "flv" or $type == "mp4" or $type == "m4v" or $type == "m4a" ) {
    			
    			if( $config['flv_watermark'] ) $watermark = ",showWatermark:'always',watermarkUrl:'{THEME}/dleimages/flv_watermark.png',watermarkLinkUrl:''";
    			else $watermark = "";
    			
    			$list = explode( ",", $url );
    			$url = array ();
    			
    			foreach ( $list as $value ) {
    				
    				$url[] = "{url:'" . trim( $value ) . "?source=1'}";
    			
    			}
    			
    			$url = implode( ", ", $url );
    			
    			return "<!--dle_video_begin:{$decode_url}--><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"425\" height=\"325\">
    				<param name=\"movie\" value=\"" . $config['http_home_url'] . "engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{overlayId:'play',url:'{$option[1]}'},{$url}],initialScale:'fit',showMenu:false,controlBarGloss:'low',controlBarBackgroundColor:-1,controlsOverVideo:'ease',startingBufferLength:1,showOnLoadBegin:true,loop:false,autoRewind:true,autoBuffering:false,autoPlay:false{$watermark}}\" />
    				<param name=\"allowFullScreen\" value=\"true\" />
    				<param name=\"quality\" value=\"high\" />
    				<param name=\"bgcolor\" value=\"#000000\" />
    				<param name=\"wmode\" value=\"transparent\" />
    				<embed src=\"" . $config['http_home_url'] . "engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{overlayId:'play',url:'{$option[1]}'},{$url}],initialScale:'fit',showMenu:false,controlBarGloss:'low',controlBarBackgroundColor:-1,controlsOverVideo:'ease',startingBufferLength:1,showOnLoadBegin:true,loop:false,autoRewind:true,autoBuffering:false,autoPlay:false{$watermark}}\" quality=\"high\" bgcolor=\"#000000\" wmode=\"transparent\" allowFullScreen=\"true\" width=\"425\" height=\"325\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
    				</object><!--dle_video_end-->";
    		
    		} elseif( $type == "avi" or $type == "divx" ) {
    			
    			return "<!--dle_video_begin:{$decode_url}--><object classid=\"clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616\" width=\"425\" height=\"341\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\">
    				<param name=\"custommode\" value=\"none\" />
    				<param name=\"mode\" value=\"zero\" />
    				<param name=\"autoPlay\" value=\"false\" />
    				<param name=\"src\" value=\"{$url}\" />
    				<param name=\"previewImage\" value=\"{$option[1]}\" />
    				<embed type=\"video/divx\" src=\"{$url}\" custommode=\"none\" width=\"425\" height=\"341\" mode=\"zero\"  autoPlay=\"false\" previewImage=\"{$option[1]}\" pluginspage=\"http://go.divx.com/plugin/download/\">
    				</embed>
    				</object><!--dle_video_end-->";
    		
    		} else {
    			
    			return "<!--dle_video_begin:{$url}--><object id=\"mediaPlayer\" width=\"380\" height=\"310\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">
    				<param name=\"url\" VALUE=\"{$url}\" />
    				<param name=\"autoStart\" VALUE=\"false\" />
    				<param name=\"showControls\" VALUE=\"true\" />
    				<param name=\"TransparentatStart\" VALUE=\"false\" />
    				<param name=\"AnimationatStart\" VALUE=\"true\" />
    				<param name=\"StretchToFit\" VALUE=\"true\" />
    				<embed pluginspage=\"http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/\" src=\"{$url}\" width=\"380\" height=\"310\" type=\"application/x-mplayer2\" autorewind=\"1\" showstatusbar=\"1\" showcontrols=\"1\" autostart=\"0\" allowchangedisplaysize=\"1\" volume=\"70\" stretchtofit=\"1\" />
    				</object><!--dle_video_end-->";
    		}
    	
    	}
    	function build_audio($url) {
    		global $config;
    		
    		$url = $this->clear_url( urldecode( $url ) );
    		
    		if( $url == "" ) return;
    		
    		if( preg_match( "/[?&;%<\[\]]/", $url ) ) {
    			
    			return "[audio=" . $url . "]";
    		}
    		
    		$list = explode( ",", $url );
    		$url = array ();
    		
    		foreach ( $list as $value ) {
    			
    			$url[] = "{url:'" . trim( $value ) . "'}";
    		
    		}
    		
    		$url = implode( ", ", $url );
    		$list = implode( ",", $list );
    		
    		return "<!--dle_audio_begin:{$list}--><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" \"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"425\" height=\"45\">
    				<param name=\"movie\" value=\"" . $config['http_home_url'] . "engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{$url}],initialScale:'fit',showMenu:false,backgroundColor:'-1',controlsOverVideo:'locked',controlBarGloss:'low',controlBarBackgroundColor:0,showFullScreenButton:false,usePlayOverlay:false,showOnLoadBegin:false,loop:false,autoRewind:true,autoBuffering:false,autoPlay:false}\" />
    				<param name=\"allowFullScreen\" value=\"true\" />
    				<param name=\"quality\" value=\"high\" />
    				<param name=\"bgcolor\" value=\"#000000\" />
    				<param name=\"wmode\" value=\"transparent\" />
    				<embed src=\"" . $config['http_home_url'] . "engine/classes/flashplayer/flv_player.swf?config={embedded:true,playList:[{$url}],initialScale:'fit',showMenu:false,backgroundColor:'-1',controlsOverVideo:'locked',controlBarGloss:'low',controlBarBackgroundColor:0,showFullScreenButton:false,usePlayOverlay:false,showOnLoadBegin:false,loop:false,autoRewind:true,autoBuffering:false,autoPlay:false}\" quality=\"high\" bgcolor=\"#000000\" wmode=\"transparent\" allowFullScreen=\"true\" width=\"425\" height=\"45\" align=\"middle\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />
    				</object><!--dle_audio_end-->";
    	
    	}
    Ето обнавит видео и аудио плаыерьа и решит проблему c buffering (т.е. загруска видео начиналась не назав на play, тепер проблем нету)

    Страйие новости и станички не измениатсиа автоматически, есле ви хотите их изменить откройте и сахраните.

    :tcl:
     
Статус темы:
Закрыта.