Extension talk:EmbedVideo

Jump to navigation Jump to search

About this board

Add "Embed Video" icon to WikiEditor toolbar

3
Felix Englisch (talkcontribs)

If you are using EmbedVideo in combination with Extension:WikiEditor, you might want to make it easier for your users to insert a video. It is quite easy to add an icon to the toolbar which automatically inserts the code snippet required for embedding. Simply add the following to you LocalSettings.php:

$wgUseSiteJs = true;


Then, open the page "MediaWiki:Common.js" on your wiki and insert the following:

var customizeToolbar = function () {
  $('#wpTextbox1').wikiEditor('addToToolbar', {
      section: 'advanced',
      group: 'insert',
      tools: {
        "Video": {
          label: 'Embed video',
          type: 'button',
          icon: '//upload.wikimedia.org/wikipedia/commons/6/64/Video_Camera_-_The_Noun_Project.svg',
          action: {
            type: 'encapsulate',
            options: {
              pre: '{{#ev:youtube|',
              peri: "Link to YouTube video",
              post: '|400|right|Caption}}'
            }
          }
        }
      }
    });
};
    
    /* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
    if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
    mw.loader.using( 'user.options' ).then( function () {
    if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
      $.when(
        mw.loader.using( 'ext.wikiEditor' ), $.ready
      ).then( customizeToolbar );
    }
  } );
}


Of course, you can change the default parameters of the video and also the icon. Just visit https://commons.wikimedia.org/wiki/Main_Page and look for a better one. And for more information about editing the toolbar, see Extension:WikiEditor/Toolbar customization.

Have fun!


Uncopy (talkcontribs)

Thanks Felix for updating you code, I removed my copy.

Felix Englisch (talkcontribs)

Thank you, User:Uncopy, that helped a lot! Due to your reply I also found some mistakes in my code (which are still in yours, I am sorry), so this was more than helpful.

Reply to "Add "Embed Video" icon to WikiEditor toolbar"
Dinoguy1000 (talkcontribs)

@Pppery: could we use a video that isn't religious for the example image and code samples throughout the page? WMF properties have enough biases as it is, without adding a religious bias as well.

Pppery (talkcontribs)
Dinoguy1000 (talkcontribs)

Having a boring-looking video might be best anyways, since it'd discourage people from focusing on the video choice much.

Pppery (talkcontribs)

It seems a little far-fetched to me that someone would make a claim of bias that the documentation for a video-embedding extension shows a video that happens to be religious.

Nevertheless, I would be willing to re-make this screenshot if someone else provides me with a link to a suitable creative-commons-licensed video on YouTube -- I don't feel like searching for a video that no one could possibly claim is objectionable myself.

Dinoguy1000 (talkcontribs)

Admittedly I might be sensitized to it because I was raised in a Baptist church. That being said, I don't think we should say "it's just a hypothetical so there's no reason to bother", especially when we have so many potential alternatives. I'll probably poke around and see if I can find something else after a bit.

Reply to "Example video"

Would adding a youtube link create a corresponding File:* page?

2
TitusiMW (talkcontribs)

I have a quick question. Would this extension create a corresponding File:* page for a youtube link so I can start using that File:* to create gallery of thumbnails etc using MediaWIki's usual media/files related features?

Dinoguy1000 (talkcontribs)

Nope. A feature like that would be useful, though (I've had a few times I've missed it while working on a wiki). Wikia/FANDOM's video tool does have that feature, though I don't know where in their codebase you'd have to look to see how it's implemented (and it's anyone's guess how much work it'd be to port that functionality to be usable on a vanilla installation).

Reply to "Would adding a youtube link create a corresponding File:* page?"

Embed video based on file directory

1
AmazingTrans (talkcontribs)

I am using a local Mediawiki, and i have a video file just say at "c:\video.mp4".

Is it possible to embed this video in the mediawiki?

Reply to "Embed video based on file directory"

The extension is still experimental

6
TespSam (talkcontribs)

Why is this extension listed as stable if it hasn't been tested on windows? Why aren't windows and ffmpeg even mentioned in the documentation?

FreedomFighterSparrow (talkcontribs)

Probably because most people don't run MediaWiki on Windows... Also, you might want to tell people what is the actual issue you are facing.

TespSam (talkcontribs)

I have a requirement to run windows on my server. The issue I'm having is that people have made assumptions. Everyone knows what happens when you assume things.

Extension looks for ffprobe in the the /usr/bin directory so that it can execute it as a shell command. Helpful suggestions have included things like "add the /usr/bin directory to the php config on your windows server" and "why aren't you running linux". I put a try catch block around it as the functionality is apparently entirely unnecessary. Seems to work fine on my test environment so I might push to production.

FreedomFighterSparrow (talkcontribs)

It looks like v2.5.2 aims to fix your issue.

TespSam (talkcontribs)

That's cool, I'm on v2.7.3.

FreedomFighterSparrow (talkcontribs)

My bad, I was looking at the dates completely wrong and figured it was something new... I'll try to fix this soon.

Edit: I took a look, and I cannot see where you would have this problem. The FFProbe class indeed checks for ffprobe, but uses a file_exists function before trying to use it, so it shouldn't cause any problems. This is certainly true in v2.7.3. What specific error are you getting?

Reply to "The extension is still experimental"
Aka sektor (talkcontribs)

What about coub.com support for this extension?

Reply to "coub.com support"
Kevin Perkin (talkcontribs)

As soon as I include the parameter wfLoadExtension( 'EmbedVideo' ); in the LocalSettings.php file I get a server error when I try and access my wiki. It's like it can't find the extension code, but that is all present in the specified directories. Has anybody else experienced similar issue?

Reply to "Installation problems"

Doesn't embed uploaded MP4 files, am I missing something?

1
DigitalManiak3k (talkcontribs)

When I try to embed an uploaded .MP4 file I use the "{{#evu:*link to mp4 on http server*|alignment=right}}" and get the result back "Couldn't parse video from *link to mp4 on http server*"

Reply to "Doesn't embed uploaded MP4 files, am I missing something?"

Doesn't Autoplay or Work with Playlists

1
ExportTester (talkcontribs)

It doesn't autoplay videos and doesn't play random songs from playlists, always starting with the same video despite random being set to on.

Reply to "Doesn't Autoplay or Work with Playlists"

No video shown in Firefox on Mac

1
94.217.90.112 (talkcontribs)

On my Mac locally stored videos are shown in Safari, but not Firefox. Does anybody know this behavior?

Reply to "No video shown in Firefox on Mac"