Browse Source

[svn r17400] FS#2867 - FCKEditor: Adding support for mp4 embedded videos.

Ivan Tcholakov 16 years ago
parent
commit
2b5c8c64e5

+ 4 - 4
main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js

@@ -414,7 +414,7 @@ FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
 		}
 	} ;
 
-// A custom handler for mpg, mpeg, avi, wmv, mov, asf, flv files and youtube streaming when a new tag has been added.
+// A custom handler for video when a new tag has been added.
 FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
 	{
 		if ( !FCK.is_video( el ) )
@@ -426,7 +426,7 @@ FCKEmbedAndObjectProcessor.AddCustomHandler( function ( el, fakeImg )
 		fakeImg.setAttribute( '_fckvideo', 'true', 0 ) ;
 	} ) ;
 
-// Fake images for mpg, mpeg, avi, wmv, mov, asf, flv files and youtube streaming when the document has been opened.
+// Fake images for video when the document has been opened.
 FCKDocumentProcessor.AppendNew().ProcessDocument = function ( document )
 	{
 		var embeds = document.getElementsByTagName( 'embed' ) ; 
@@ -647,7 +647,7 @@ FCK.is_video = function ( tag )
 			// There are three plugins dealing with video content. Detection looks a bit messy.
 
 			// Embedded video.
-			if ( /\.(mpg|mpeg|avi|wmv|mov|asf)/i.test( tag.src ) )
+			if ( /\.(mpg|mpeg|mp4|avi|wmv|mov|asf)/i.test( tag.src ) )
 			{
 				return true ;
 			}
@@ -695,7 +695,7 @@ FCK.get_video_type = function ( img )
 	}
 
 	// Embedded video.
-	if ( /\.(mpg|mpeg|avi|wmv|mov|asf)/i.test( tag.src ) )
+	if ( /\.(mpg|mpeg|mp4|avi|wmv|mov|asf)/i.test( tag.src ) )
 	{
 		return 'embedded_video' ;
 	}

+ 7 - 5
main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.js

@@ -110,11 +110,11 @@ function CreateEmbeddedMovie(e, url)
 {
 
 	var sType, pluginspace, codebase, classid;
-	var sExt = url.match(/\.(mpg|mpeg|avi|wmv|mov|asf)$/i);
+	var sExt = url.match(/\.(mpg|mpeg|mp4|avi|wmv|mov|asf)$/i);
 
 	if (sExt ==null)
 	{
-		alert('We only support these extensions mpg, mpeg, avi, wmv, mov and asf. ')
+		alert('We only support these extensions mpg, mpeg, mp4, avi, wmv, mov and asf. ')
 		return false;
 	}
 	else
@@ -124,9 +124,11 @@ function CreateEmbeddedMovie(e, url)
 		else
 			sExt = '';
 			
-		sType = (sExt=="mpg"||sExt=="mpeg")             ?"video/mpeg":
-	          (sExt=="avi"||sExt=="wmv"||sExt=="asf") ?"video/x-msvideo":
-					  (sExt=="mov") ?"video/quicktime" : "video/x-msvideo";
+		sType = (sExt=="mpg"||sExt=="mpeg") ? "video/mpeg" :
+				(sExt=="avi"||sExt=="wmv"||sExt=="asf") ? "video/x-msvideo" :
+				(sExt=="mov") ? "video/quicktime" :
+				(sExt=="mp4") ? "video/mpeg4-generic" :
+				"video/x-msvideo" ;
 		
 		// window media player?
 		var wmp = sExt != "mov";