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

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: