OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



HOWTO: Upload and embed media into galley pages

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

HOWTO: Upload and embed media into galley pages

Postby mcrider » Wed Jun 11, 2008 12:54 pm

With the nearing release of OJS 2.2.1, here is a quick guide on how to embed audio and video directly into HTML Galley pages (which is already available in CVS):

OJS Supports several techniques of embedding video and audio into HTML articles. The simplest way is to use the <embed> tag, with the name of the file (which has been uploaded in the HTML galley images section) as the src parameter. For example:
Code: Select all
<embed src="filename.ext" width="300" height="200"></embed>

This will embed the media player appropriate for the file type being played (i.e. Flash player, Quicktime, Windows Media Player). OJS will automatically rewrite the filename to the URL OJS uses internally for that file.

To use a media player with more features, we suggest Flowplayer (http://www.flowplayer.org). To use Flowplayer, you must play your files in a playlist, even if there is only one file in it. This informs Flowplayer what file type is being played, which is necessary for it to function. For example:

Code: Select all
<head> 
   <script type="text/javascript" src="http://yourdomain.com/flashembed.min.js"></script>
</head>

<script>
   window.onload = function() { 
      flashembed("example",
      { src:'http://yourdomain.com/FlowPlayerDark.swf',
      width: 400,
      height: 350
      },
      { config: {   
         playList: [ { url:'video.swf', type: 'swf' } ]
             }}
       );
   }
</script>

<div id="example"></div>


Which will play the file video.swf using the dark Flowplayer skin. The skins and Javascript file are included with Flowplayer, and should be placed somewhere on your web server so that multiple pages can access it.

When using Flowplayer to play audio files (e.g. MP3s), it may be useful to set the height to something smaller, so only the controls are shown.

As always, please let us know if there are any issues you have with this!

Kind regards,
Matt Crider
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: HOWTO: Upload and embed media into galley pages

Postby jspeer » Fri Feb 12, 2010 7:38 am

Hello,
I'm trying to upload an mp4 file under the images section of an HTML galley, but when I click save it doesn't appear in the list of uploaded image files. Not having the problem with uploading images and it's not a file size issue. Are there only certain audio and video file types accepted for upload in the images section?
Thanks for your help!
--Julie
jspeer
 
Posts: 8
Joined: Mon Oct 13, 2008 7:59 am

Re: HOWTO: Upload and embed media into galley pages

Postby jmacgreg » Tue Feb 16, 2010 9:52 pm

Hi jspeer,

You may be hitting a filesize issue, where your server or PHP isn't configured to accept files of that size. You can check this by trying to upload a very small .mp4 file. See here for more troubleshooting advice.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: HOWTO: Upload and embed media into galley pages

Postby dwilson » Tue Oct 26, 2010 5:45 am

Hello,

I am having a different problem in trying to do something similar and wonder if anyone can advise?

I have succeeded in embedding the remote player into a page as per the instructional PDF, however, I get several error messages as well as the player embedded and don't know how to resolve these?

I am using the boomp3.com player (shockwave) which provides an embed code to my link (which I need to stream remotely from dropbox as it's too large for houndbite.

I'm attaching a grab of the error messages and am pasting my xml page which is the galley (HTML) page I am using. The embed code begins at the point <html>

errors.tiff
errors.tiff (192.88 KiB) Viewed 7067 times



XML PAGE:
---
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>Interview: Darwin and Genomics</title>
<author>John Dupré</author>
</titleStmt>
<editionStmt>
<edition>
<date>2010-10-08T15:17:00</date>
</edition>
</editionStmt>
<publicationStmt>
<authority/>
</publicationStmt>
<sourceDesc>
<p></p>
</sourceDesc>
</fileDesc>

</teiHeader>
<text>
<body>
<div>

<p><emph>In an interview with Regenia Gagnier, the philosopher of science John Dupré discusses some of the fundamental concepts of genomics and their implications for human nature and freedom. </emph>
</p>

<p>
To stream a recording of the interview, please click the player, below.
</p>

</div>
</body>

</text>

</TEI>

<html>
<object style="vertical-align: middle;" valign="middle" width="200" height="20"><param name="movie" value="http://static.boomp3.com/player2.swf?id=o2l9v6hnu7k&title=JohnDupreInterview"></param>
<param name="allowFullScreen" value="false"></param>
<param name="allowscriptaccess" value="always"></param><embed
src="http://static.boomp3.com/player2.swf?id=o2l9v6hnu7k&title=JohnDupreInterview" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="200" height="20" wmode="transparent"></embed>
</object>
</html>

----


Any advice very gratefully received.
dwilson
 
Posts: 3
Joined: Tue Oct 26, 2010 3:20 am

Re: HOWTO: Upload and embed media into galley pages

Postby jmacgreg » Fri Oct 29, 2010 3:09 pm

Hi there,

The error message isn't coming through -- can you post in plaintext, and tell us exactly which page your see it in?

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: HOWTO: Upload and embed media into galley pages

Postby dwilson » Tue Nov 02, 2010 7:40 am

Yes, sure:

Warning: DOMDocument::load() [domdocument.load]: Extra content at the end of the document in /var/www/nineteen/files/journals/3/articles/591/public/591-952-12-PB.xml, line: 42 in /var/www/nineteen/ojs/plugins/generic/xmlGalley/ArticleXMLGalley.inc.php on line 306

Warning: Invalid argument supplied for foreach() in /var/www/nineteen/ojs/plugins/generic/xmlGalley/ArticleXMLGalley.inc.php on line 316
John Dupré 2010-10-08T15:17:00

Supposed to be publishing very soon so would be massively grateful for any help.

Daniel
dwilson
 
Posts: 3
Joined: Tue Oct 26, 2010 3:20 am

Re: HOWTO: Upload and embed media into galley pages

Postby jmacgreg » Wed Nov 03, 2010 10:27 am

Hi Daniel,

Your XML file isn't properly formatted, it doesn't look like. If I upload a file formatted like the one below, everything seems to work fine:

Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0">
    <teiHeader>
        <fileDesc>
            <titleStmt>
                <title>Interview: Darwin and Genomics</title>
                <author>John Dupré</author>
            </titleStmt>
            <editionStmt>
                <edition>
                    <date>2010-10-08T15:17:00</date>
                </edition>
            </editionStmt>
            <publicationStmt>
                <authority/>
            </publicationStmt>
            <sourceDesc>
                <p></p>
            </sourceDesc>
        </fileDesc>
       
    </teiHeader>
    <text>
        <body>
            <div>
               
                <p><emph>In an interview with Regenia Gagnier, the philosopher of science John Dupré discusses some of the fundamental concepts of genomics and their implications for human nature and freedom. </emph>
                </p>
               
                <p>
                    To stream a recording of the interview, please click the player, below.
                </p>
                <object style="vertical-align: middle;" valign="middle" width="200" height="20"><param name="movie" value="http://static.boomp3.com/player2.swf?id=o2l9v6hnu7k&title=JohnDupreInterview"></param>
                    <param name="allowFullScreen" value="false"></param>
                    <param name="allowscriptaccess" value="always"></param><embed
                        src="http://static.boomp3.com/player2.swf?id=o2l9v6hnu7k&title=JohnDupreInterview" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="false" width="200" height="20" wmode="transparent"></embed>
                </object>         
            </div>
        </body>
       
    </text>
   
</TEI>


(Note that this file still doesn't validate -- it chokes on the <param ...> tag in the object block. I'm not a TEI expert, but you may want to spend time ensuring that the file does validate.)

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: HOWTO: Upload and embed media into galley pages

Postby dwilson » Mon Nov 08, 2010 5:23 am

Hi,
Many thanks for the reply. I've tried re-formatting the XML as you suggest, but now get slightly different errors displaying.
--
Warning: DOMDocument::load() [domdocument.load]: EntityRef: expecting ';' in /var/www/nineteen/files/journals/3/articles/591/public/591-952-13-PB.xml, line: 33 in /var/www/nineteen/ojs/plugins/generic/xmlGalley/ArticleXMLGalley.inc.php on line 306

Warning: DOMDocument::load() [domdocument.load]: EntityRef: expecting ';' in /var/www/nineteen/files/journals/3/articles/591/public/591-952-13-PB.xml, line: 36 in /var/www/nineteen/ojs/plugins/generic/xmlGalley/ArticleXMLGalley.inc.php on line 306

Warning: Invalid argument supplied for foreach() in /var/www/nineteen/ojs/plugins/generic/xmlGalley/ArticleXMLGalley.inc.php on line 316
John Dupré 2010-10-08T15:17:00
--
Unfortunately we've now published the issue, but fortunately this means you can see the error messages yourself at:

http://www.19.bbk.ac.uk/index.php/19/ar ... ew/591/648

Can you help decipher what these errors mean?

Many thanks again,
Daniel
dwilson
 
Posts: 3
Joined: Tue Oct 26, 2010 3:20 am

Re: HOWTO: Upload and embed media into galley pages

Postby jmacgreg » Wed Nov 10, 2010 11:22 am

Hi Daniel,

What's your galley-creating workflow like, and specifically, how and why are you creating TEI documents? Are all your articles encoded in TEI before uploading? If you are only having problems with this one file, you may just want to convert it entirely to well-formed HTML and try uploading again. You may also want to look into suppressing PHP warnings -- the file does seem to work just fine as is.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: HOWTO: Upload and embed media into galley pages

Postby JackM » Tue Dec 14, 2010 11:30 am

Hello,

Making a plan and I notice part of Julie's question wasn't answered. Are there types of audio or video that this will not support in images?

Thanks.
JackM
 
Posts: 2
Joined: Tue Dec 14, 2010 11:20 am

Re: HOWTO: Upload and embed media into galley pages

Postby JackM » Tue Dec 14, 2010 11:52 am

Hello,

Planning my workflow and wondering about the general part of Julie's question. Are there video/audio formats not accepted in images section? Thanks.
JackM
 
Posts: 2
Joined: Tue Dec 14, 2010 11:20 am

Re: HOWTO: Upload and embed media into galley pages

Postby jmacgreg » Thu Dec 16, 2010 2:24 pm

Hi Jack,

Nope -- you should be able to upload anything there.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: HOWTO: Upload and embed media into galley pages

Postby njnosko » Thu Jan 31, 2013 2:45 pm

I'm having the same problem as Julie did above. I'm trying to upload certain file types under the images section of an HTML galley, but when I click save it doesn't appear in the list of uploaded image files. For example, some file extensions it doesn't accept are .ogg, .pdf, and .exe.

Not having the problem with uploading other file types like .mp4, .jpg, or .swf. It's not a file size issue as I've uploaded a 3MB .mp4 successfully but a 200KB .pdf fails. I've configured php.ini to allow file sizes up to 1GB. Are there only certain audio and video file types accepted for upload in the images section? I know in your previous post you say that any file can be uploaded but it doesn't seem to be the case. Unless there is some config that I'm missing. Thanks for any help on this.

I'm running OJS 2.3.7 if that helps.

-Nick
njnosko
 
Posts: 4
Joined: Thu Nov 29, 2012 1:28 pm

Re: HOWTO: Upload and embed media into galley pages

Postby njnosko » Fri Feb 01, 2013 8:00 am

Can anyone confirm if this is what limits what file types can be uploaded into the Images section of a Galley?

According to James above, any file type can be uploaded but we are finding that not to be the case. We are trying to find the acceptable file types and this seems to be the best list we can find.



lib/pkp/classes/file/FileManager.inc.php

/**
* Returns file extension associated with the given image type,
* or false if the type does not belong to a recognized image type.
* @param $type string
*/
function getImageExtension($type) {
switch ($type) {
case 'image/gif':
return '.gif';
case 'image/jpeg':
case 'image/pjpeg':
return '.jpg';
case 'image/png':
case 'image/x-png':
return '.png';
case 'image/vnd.microsoft.icon':
case 'image/x-icon':
case 'image/x-ico':
case 'image/ico':
return '.ico';
case 'application/x-shockwave-flash':
return '.swf';
case 'video/x-flv':
case 'application/x-flash-video':
case 'flv-application/octet-stream':
return '.flv';
case 'audio/mpeg':
return '.mp3';
case 'audio/x-aiff':
return '.aiff';
case 'audio/x-wav':
return '.wav';
case 'video/mpeg':
return '.mpg';
case 'video/quicktime':
return '.mov';
case 'video/mp4':
return '.mp4';
case 'text/javascript':
return '.js';
default:
return false;
}
}
njnosko
 
Posts: 4
Joined: Thu Nov 29, 2012 1:28 pm


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 2 guests