From: nicolasconnault Date: Thu, 15 Mar 2007 01:53:27 +0000 (+0000) Subject: MDL-8870 - All major file formats (mp3, mpeg, wmv, mov, avi, swf) now support embeddi... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=05f9928e87dfa5bff8e871aee8c16d3412e8909c;p=moodle.git MDL-8870 - All major file formats (mp3, mpeg, wmv, mov, avi, swf) now support embedding when required, in all major browsers. --- diff --git a/mod/resource/type/file/resource.class.php b/mod/resource/type/file/resource.class.php index 26a3d466b6..7d31f6399c 100644 --- a/mod/resource/type/file/resource.class.php +++ b/mod/resource/type/file/resource.class.php @@ -214,8 +214,8 @@ function display() { $formatoptions = new object(); $formatoptions->noclean = true; - - if ($resource->options != "frame") { + + if ($resource->options == "frame") { // TODO nicolasconnault 14-03-07: This option should be renamed "embed" if (in_array($mimetype, array('image/gif','image/jpeg','image/png'))) { // It's an image $resourcetype = "image"; @@ -233,10 +233,14 @@ function display() { $resourcetype = "quicktime"; $embedded = true; - } else if ($mimetype == "application/x-shockwave-flash") { // It's a Quicktime file + } else if ($mimetype == "application/x-shockwave-flash") { // It's a Flash file $resourcetype = "flash"; $embedded = true; + } else if ($mimetype == "video/mpeg") { // It's a Mpeg file + $resourcetype = "mpeg"; + $embedded = true; + } else if ($mimetype == "text/html") { // It's a web page $resourcetype = "html"; } @@ -419,29 +423,35 @@ function display() { } else { $c = 'bgColour=000000&btnColour=ffffff&btnBorderColour=cccccc&iconColour=000000&'. 'iconOverColour=00cc00&trackColour=cccccc&handleColour=ffffff&loaderColour=ffffff&'. - 'font=Arial&fontColour=3333FF&buffer=10&waitForPlay=no&autoPlay=yes'; + 'font=Arial&fontColour=FF33FF&buffer=10&waitForPlay=no&autoPlay=yes'; } $c .= '&volText='.get_string('vol', 'resource').'&panText='.get_string('pan','resource'); $c = htmlentities($c); echo '
'; - echo '
'; - echo ''; + echo '
'; + echo ''; echo ''; echo ''; - echo ''; + echo ''; echo ''; - echo ''; - echo ''; + echo ''; + echo ""; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '' . $fullurl . ''; + echo ''; + echo ''; + echo ''; echo ''; echo '
'; - echo ''; - + echo ''; } else if ($resourcetype == "mediaplayer") { echo '
'; @@ -454,25 +464,58 @@ function display() { echo '
'; echo '
'; - } else if ($resourcetype == "quicktime") { + } else if ($resourcetype == "mpeg") { + echo '
'; + echo ''; + echo ""; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ""; + echo "$fullurl"; + echo ''; + echo '' . $fullurl . ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
'; + } else if ($resourcetype == "quicktime") { + echo ''; echo '
'; - echo ''; + + echo ''; echo ""; echo ''; echo ''; echo ''; echo ''; - echo ''; - echo ""; + + echo ""; echo ''; echo ''; echo ''; echo ''; echo ''; - echo ''; + echo '' . $fullurl . ''; echo ''; echo ''; } else if ($resourcetype == "flash") { @@ -491,7 +534,7 @@ function display() { echo ''; echo ''; echo ''; - echo '

Your browser does not support Embedded Flash

'; + echo '' . $fullurl . ''; echo ''; echo '
'; echo '';