From feaabf819601735b36b484f0777fbc087235e00f Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Wed, 9 Feb 2011 21:50:46 +0200 Subject: [PATCH] Task #2541 - flvPlayer: Now Flash embedding technique can be 'embed', 'object', 'adobe' (by default), and 'swfobject'. --- .../editor/plugins/flvPlayer/flvPlayer.js | 177 +++++++++++++++++- main/inc/lib/fckeditor/myconfig.php | 8 +- 2 files changed, 180 insertions(+), 5 deletions(-) diff --git a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js index fda8ad2246..89e31ff942 100755 --- a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js +++ b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js @@ -12,6 +12,12 @@ if ( typeof FCKConfig[ 'FlashEmbeddingMethod' ] != 'string' ) { FCKConfig[ 'FlashEmbeddingMethod' ] = 'embed' ; } +if ( FCKConfig[ 'FlashEmbeddingMethod' ] != 'embed' && + FCKConfig[ 'FlashEmbeddingMethod' ] != 'object' && + FCKConfig[ 'FlashEmbeddingMethod' ] != 'adobe' && + FCKConfig[ 'FlashEmbeddingMethod' ] != 'swfobject' ) { + FCKConfig[ 'FlashEmbeddingMethod' ] = 'embed' ; +} // Set the language direction. window.document.dir = FCKLang.Dir ; @@ -501,15 +507,175 @@ Media.prototype.getInnerHTML = function ( objectId ) // The player's area. s += '
' ; - if (embeddingMethod == 'swfobject') + if ( embeddingMethod == 'swfobject' ) { s += 'Get the Flash Player to see this video.' ; } - else + + if ( embeddingMethod == 'object' || embeddingMethod == 'adobe' ) { - // 'embed' method. + var p = '' ; // Parameters. + var v = '' ; // Variables. + + s += '' ; + + p += '' ; + p += '' ; + p += '' ; + + v += 'width=' + thisWidth + '&' ; + v += 'height=' + thisHeight + '&' ; + v += 'autostart=' + this.play + '&' ; + + if ( thisMediaType == 'mpl' ) + { + v += 'file=' + this.purl + '&' ; + v += 'autoscroll=true&' ; + p += 'allowscriptaccess="always" ' ; + p += '' ; + + var dispWidth = thisWidth ; + var dispHeight = thisHeight ; + var dispThumbs = false ; + + if ( this.dispPlaylist != 'none' ) + { + if ( this.dispPlaylist == 'right' ) + { + if ( this.playlistDim.length > 0 ) + { + dispWidth = thisWidth - this.playlistDim ; + if ( this.playlistDim < 100 ) + { + dispThumbs = false ; + } + else + { + dispThumbs = true ; + } + } + else + { + if ( thisWidth >= 550 ) + { + dispWidth = thisWidth - 200 ; + dispThumbs = true ; + } + else if ( thisWidth >= 450 ) + { + dispWidth = thisWidth - 100 ; + dispThumbs = false ; + } + else if ( thisWidth >= 350 ) + { + dispWidth = thisWidth - 50 ; + dispThumbs = false ; + } + } + + v += 'displaywidth=' + dispWidth + '&' ; + } + else if ( this.dispPlaylist == 'below' ) + { + dispThumbs = true ; + + if ( this.playlistDim.length > 0 ) + { + dispHeight = thisWidth - this.playlistDim ; + } + else + { + if ( thisHeight >= 550 ) + { + dispHeight = thisWidth - 200 ; + } + else if ( thisHeight >= 450 ) + { + dispHeight = thisHeight - 150 ; + } + else if ( thisHeight >= 350 ) + { + dispHeight = thisHeight - 100 ; + } + } + + v += 'displayheight=' + dispHeight + '&' ; + } + + if ( this.playlistThumbs == 'false' ) + { + dispThumbs = false ; + } + + v += 'thumbsinplaylist=' + dispThumbs + '&' ; + } + + v += 'shuffle=false&' ; + if (this.loop) + { + v += 'repeat=list&' ; + } + else + { + v += 'repeat=' + this.loop + '&' ; + } + //v += 'transition=bgfade&' ; + } + else + { + v += 'file=' + this.url + '&' ; + v += 'repeat=' + this.loop + '&' ; + v += 'image=' + this.iurl + '&' ; + } + + v += 'showdownload=' + this.downloadable + '&' ; + v += 'link=' + this.url + '&' ; + + v += 'showdigits=' + this.displayDigits + '&' ; + v += 'shownavigation=' + this.displayNavigation + '&' ; + + + // SET THE COLOR OF THE TOOLBAR + var colorChoice1 = this.toolcolor ; + if ( colorChoice1.length > 0 ) + { + colorChoice1 = colorChoice1.replace( '#', '0x' ) ; + v += 'backcolor=' + colorChoice1 + '&' ; + } + // SET THE COLOR OF THE TOOLBARS TEXT AND BUTTONS + var colorChoice2 = this.tooltcolor ; + if ( colorChoice2.length > 0 ) + { + colorChoice2 = colorChoice2.replace( '#', '0x' ) ; + v += 'frontcolor=' + colorChoice2 + '&' ; + } + // SET COLOR OF ROLLOVER TEXT AND BUTTONS + var colorChoice3 = this.tooltrcolor ; + if ( colorChoice3.length > 0 ) + { + colorChoice3 = colorChoice3.replace( '#', '0x' ) ; + v += 'lightcolor=' + colorChoice3 + '&' ; + } + // SET COLOR OF BACKGROUND + var colorChoice4 = this.bgcolor ; + if ( colorChoice4.length > 0 ) + { + colorChoice4 = colorChoice4.replace( '#', '0x' ) ; + v += 'screencolor=' + colorChoice4 + '&' ; + } + + v += 'logo=' + this.wmurl + '&' ; + if ( this.rurl.length > 0 ) + { + v += 'recommendations=' + this.rurl + '&' ; + } + + s += p + '' ; + } + if ( embeddingMethod == 'object' || embeddingMethod == 'adobe' ) + { var p = '' ; // Parameters (attributes). var v = '' ; // Variables. @@ -672,6 +838,11 @@ Media.prototype.getInnerHTML = function ( objectId ) s += '' ; } + if ( embeddingMethod == 'object' || embeddingMethod == 'adobe' ) + { + s += '' ; + } + s += '
' ; // Generation of a javascript that implements the swfobject embedding method. diff --git a/main/inc/lib/fckeditor/myconfig.php b/main/inc/lib/fckeditor/myconfig.php index aba2000ef4..4859cb95b1 100755 --- a/main/inc/lib/fckeditor/myconfig.php +++ b/main/inc/lib/fckeditor/myconfig.php @@ -125,9 +125,13 @@ $config['LoadPlugin'][] = 'fckEmbedMovies'; // flvPlayer : Adds a dilog for inserting video files (.flv, .mp4), so they to be viewed through a flash-based player. $config['LoadPlugin'][] = 'flvPlayer'; -// Choosing Flash embedding technique: 'embed', 'object', 'swfobject' +// Choosing Flash embedding technique: +// 'embed' - tag is used, this is the oldest way that is still supported by most of the browsers; +// 'object' - tag is used, specific for Internet Explorer; +// 'adobe' - this is the "adobe way" - , it works very well, but the tag is not XML-compliant; +// 'swfobject' - this is a technique that uses a special javascript, it works very well if javasripts are not disabled (due to security reasons). // This setting works only for the plugin 'flvPlayer' so far. -$config['FlashEmbeddingMethod'] = 'swfobject' ; +$config['FlashEmbeddingMethod'] = 'adobe' ; // youtube : Adds a dilog for inserting YouTube video-streams. if (api_get_setting('youtube_for_students') == 'true') {