Add kindeditor online video playback function (the original flash upload, based

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

Kindeditor itself supports flash upload function, but we often need to upload some flv, MP4 or other type of video.

In fact, the broadcast function is realized by jwplayer. I only simple modifications to the kindeditor. The need to modify the file two.

Open the kindeditor\kindeditor.js file

The following statement function modification

[javascript] view plaincopyprint?

  1. //The modified function of by zhjx922
  2. function _mediaEmbed(attrs) {
  3. var html = '<embed id="player" name="player" allowscriptaccess="always" allowfullscreen="true" ';
  4. _each(attrs, function(key, val) {
  5. html += key + '="' + val + '" ';
  6. });
  7. html += '/>';
  8. return html;
  9. }

Open the kindeditor\plugins\flash\flash.js file

Will your content:

[javascript] view plaincopyprint?

  1. var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
  2. src : url,
  3. type : K.mediaType('.swf'),
  4. width : width,
  5. height : height,
  6. quality : 'high'
  7. });


Amended as: [javascript] view plaincopyprint?

  1. var html = K.mediaImg(self.themesPath + 'common/blank.gif', {
  2. flashvars : 'file=' + url,
  3. src : 'plugins/jwplayer/player.swf',
  4. type : K.mediaType('.swf'),
  5. width : width,
  6. height : height,
  7. quality : 'high'
  8. });


Then about 140 rows around:

urlBox.val(attrs.src);

Amended as:

urlBox.val(attrs.flashvars);


Then the need to display the video page in the following code:

Head add: <script type="text/javascript" src="plugins/jwplayer/jwplayer.js"></script>

In the input video code plus:

[javascript] view plaincopyprint?

  1. <script type='text/javascript'>
  2. //Non video, not loading the player
  3. if(document.getElementById('player')!=null)
  4. {
  5. jwplayer('player').onReady(function() {});
  6. jwplayer('player').onPlay(function() {});
  7. //jwplayer('player').play(); //Auto play?
  8. }
  9. </script>
  10. OK.




Attachment to download address

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Beau at December 03, 2013 - 10:11 PM