Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33390

Improve TinyMCE support to display video previews from video repositories

    Details

    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE

      Description

      TinyMCE preview popup

      • Give repository plugins the ability to specify the type of video (flash, mp3, wmp, etc). Video repositories similar to Youtube will not provide the file extension in the source URL. However Youtube has special treatment in that the following code is executed when www.youtube.com is found

        // YouTube
            if (v.match(/watch\?v=(.+)(.*)/)) {
                f.src.value = 'http://www.youtube.com/v/' + v.match(/v=(.*)(.*)/)[0].split('=')[1];
                return 'flash';
            } else if (v.match(/v\/(.+)(.*)/))
                return 'flash';

      The code above causes a Chrome to display a plug-in not found error message, when using a video repository plug-in other than youtube. Take the following example output that is generated in the TinyMCE preview popup while using Chrome:

      Youtube

       
      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="300" height="225" id="moodlemediaid" name="moodlemedianame" align="">
      <param name="src" value="http://www.youtube.com/v/c--LBMDGa8k">
      <param name="url" value="http://www.youtube.com/v/c--LBMDGa8k">
      <param name="width" value="300">
      <param name="height" value="225">
      <param name="id" value="moodlemediaid">
      <param name="name" value="moodlemedianame">
      <param name="align" value="">
      <embed type="application/x-shockwave-flash" src="http://www.youtube.com/v/c--LBMDGa8k" width="300" height="225" id="moodlemediaid" name="moodlemedianame" align="">
      </object>

      Kaltura

      <object classid="undefined" codebase="undefined" width="300" height="225" id="moodlemediaid" name="moodlemedianame" align="">
      <param name="src" value="http://www.kaltura.com/index.php/kwidget/wid/_787032/uiconf_id/6709411/entry_id/1_obhus6ao">
      <param name="url" value="http://www.kaltura.com/index.php/kwidget/wid/_787032/uiconf_id/6709411/entry_id/1_obhus6ao">
      <param name="width" value="300">
      <param name="height" value="225">
      <param name="id" value="moodlemediaid">
      <param name="name" value="moodlemedianame">
      <param name="align" value="">
      <embed type="null" src="http://www.kaltura.com/index.php/kwidget/wid/_787032/uiconf_id/6709411/entry_id/1_obhus6ao" width="300" height="225" id="moodlemediaid" name="moodlemedianame" align="">
      </object>

      Notice the classid and codebase parameter is undefined. I haven't tried this out in IE yet. However I'm sure that IE won't like the missing parameters as well.

      One thing to note however is that FF12 has no problems with the Kaltura generated embed code.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              salvetore Michael de Raadt added a comment -

              Thanks for sharing that.

              Show
              salvetore Michael de Raadt added a comment - Thanks for sharing that.
              Hide
              skodak Petr Skoda added a comment -

              Thanks for the report, this should be now fixed in 2.4dev by MDL-33041, the preview is using standard media library for embedding, everything that core supports will preview now.

              Show
              skodak Petr Skoda added a comment - Thanks for the report, this should be now fixed in 2.4dev by MDL-33041 , the preview is using standard media library for embedding, everything that core supports will preview now.
              Hide
              adelamarre Akin Delamarre added a comment -

              Is this fix going to be back ported to previous versions of Moodle 2?

              Show
              adelamarre Akin Delamarre added a comment - Is this fix going to be back ported to previous versions of Moodle 2?
              Hide
              skodak Petr Skoda added a comment -

              Maybe, see MDL-33982.

              Show
              skodak Petr Skoda added a comment - Maybe, see MDL-33982 .
              Hide
              adelamarre Akin Delamarre added a comment -

              Hello Petr, unfortunately it is fixed, but it doesn't address the issue that I intentionally brought up, regarding the handling of URLs to media repositories (similar to Youtube). Please see MDL-35365 for a more detailed version.

              Show
              adelamarre Akin Delamarre added a comment - Hello Petr, unfortunately it is fixed, but it doesn't address the issue that I intentionally brought up, regarding the handling of URLs to media repositories (similar to Youtube). Please see MDL-35365 for a more detailed version.

                People

                • Votes:
                  2 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: