I have been able to add video and audio mediaelement players using Content Types and fields. After looking at the mediaelementsjs.com site I got the impression I could add the players to a Basic Page Node using the CKEditor and HTML code. Am I wrong or has anyone been able to do this? Sorry if this is a dumb question, I'm new to Drupal.

Thanks, Ethan

Comments

JamesBecht’s picture

subscribe... same question.

ar-jan’s picture

Title: add mediaelement video-audio players using CKEditor? » How to use MediaElement video/audio player with CKEditor?
Component: Miscellaneous » Documentation

I was also looking into how to use this. I know next to nothing about MediaElement/HTML5, but here's what I did and it seems to work. Let me know if there's a better way.

  1. Install MediaElement as per readme.txt
  2. Go to Configuration > Media > MediaElement.js: "Enable MediaElement.js site wide"
  3. If your input format uses a HTML filter, add the <audio> and/or <video> tag to the allowed HTML tags.
  4. In CKEditor, go to source view and add something like <audio id="audioplayer" src="/sites/default/files/my-audio-file.mp3"></audio>
    1. I'm using this as a workaround, adding the audio files themselves via Media module in the hope/expectation audio (e.a.) will be supported by Media in the future. Issue: #1016376: Expose the media types allowed for WYSIWYG variable in the UI.
mfer’s picture

Status: Active » Fixed

For audio in a textarea you'll need to follow what #2 outlines. If you want to use Video you can follow what #2 outlines or you can setup mediaelement to be the player through the media module and insert video inline.

Basically, #2 hit it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

smscotten’s picture

Version: 7.x-1.0-beta3 » 7.x-1.1
Status: Closed (fixed) » Active

Sorry to reopen an issue, but I'm looking for further clarification.

The first step in #2: "install MediaElement as per readme.txt" includes a bunch of code that should be added to the page, but it's not specific as to how or where. My best guess is that that code needs to be added to theme_preprocess_page() in one's theme's template.php file. Is this right?

Also, it's not clear in #3 how much of the process in #2 can be replaced by setting up mediaelement through the media module. Obviously the module still needs to be installed so it's not all of #2. If I want to drop a video into an arbitrary node without adding fields, can I do that with the media module and not mess with my template.php file?

Thank you!

ar-jan’s picture

For basic usage you don't need to add any code, I was referring to these steps in the Drupal module's readme.txt:
1. Download MediaElement from http://mediaelementjs.com/
2. Unzip into a libraries directory as supported by the libraries module with the name mediaelement (e.g., /sites/all/libraries/mediaelement).
3. Install the libraries and mediaelement modules.

I have so far only used this with audio I uploaded via Media module and then inserted manually into the node's body , but I don't think you need to have any code in template files for video usage.
It looks like you just go Configuration > Media > Media Types > Video: Manage display, and there select 'MediaElement Video' as the formatter, and insert the video into the body.

Actually, it looks like this should also be possible for audio files now, if correct, is that newly added?
Edit: or maybe not yet for audio, I just read http://drupal.org/node/1016376#comment-4850054.

smscotten’s picture

OK, thank you.

1. Got that
2. Check.
3. Got it.

I have Configuration > Media > File Types rather than "Media Types" but I assume they are the same thing.

From there, Video > Manage Display looks like it refers only to fields. But there is also "Manage File Display." That gives me a list of "Enabled Displays", "Display Precedence", and "Display Settings." Nothing labeled a formatter and none of these sections has any tooltip help to enlighten as to their purpose.

Under Display Settings are tabbed display types (MediaElement Video appears twice.) Clicking on one of those brings up the same list of "Enabled Displays" and "Display Precedence" to order the display types that are selected. Can you provide some kind of context as to what I should do with all this? "Select 'MediaElement Video' as the formatter" doesn't match up to what I'm seeing.

ar-jan’s picture

The site I was checking is still on an older version of Media, I read that there was a significant change which is why you're seeing 'Manage File Display', etc. instead of what I wrote.
I would try out all options related to 'Display...', and choose MediaElement Video. It seems like this should just work, but I haven't tried it yet. Or someone else could chime in with more informed advice...

luthien’s picture

Hi, the module works fine but I have a small problem. The player is not visible for droid phones. Can anyone test it and let me know if they see the player in a droid device? this was for playing a MP3 file.

DjBoogy’s picture

Same thing over here too

jnettik’s picture

Status: Active » Closed (outdated)

This is an old issue. Closing.