This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JForum and the fly likes Displaying and running a video in JForum Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Displaying and running a video in JForum" Watch "Displaying and running a video in JForum" New topic
Author

Displaying and running a video in JForum

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi,
I am able to upload (as an attachment) a video to JForum, but can anyone please tell me how I can get it to display as a video which a user can just click to play, rather than a file to download?
Many thanks.
Rav
[originally posted on jforum.net by Rav]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
To play a video it has to be wrapped in an appropriate set of <object.. tags. This should specify a player "plug-in" that can handle the type of video you want to display. Preferably, a player that will run on all types of machines (e.g. Mac, Linux, Windows...) and is commonly available. FYI, youtube uses Flash Shockwave (and converts uploaded videos to this format). >

Currently, there is no support to identify video attachments and wrap them in the correct player.

However, if you want to play around with getting this to work, you might be able to convert the post_show_attachment_inc.htm template file to do this.

Basically, I think the "a" loop variable is the handle to an Attachment object. From this you can use the info property to find all sorts of info about the file and use this to write out the appropriate <object... /object> HTML to display the video.

One thing to note is that this might take a lot of bandwidth if you want to support this. Unlike YouTube links, you're server will be supplying the video "stream" A lot of users looking at videos can eat up a lot of bandwidth.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Monroe,
Many thanks for taking the time to reply.
Cheers,
rav
[originally posted on jforum.net by Rav]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
One more question please. How can you get a youtube link to render an image on JForum. I've tried enabling HTML in the post, but it doesn't make a difference.

e.g.
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/xiTuaZvmgaI"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/xiTuaZvmgaI" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
[originally posted on jforum.net by Rav]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Create a new bbcode. Open the file WEB-INF/config/bb_config.xml and add the respective code there. For example, you can create a [youtube] tag that renders the <object> tag.

After you edit this file, go to Admin Panel -> Cache -> Reload BB Code.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi All,

I would like to integrate the same functionality. I played around with the <match> tag in bb_code config file. but I couldnt able to render the image of the link. Is that possible for anyone to explain in more detail.


Thanks in advance

Cheers
[originally posted on jforum.net by Supernus]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
need captcha for jforum
[originally posted on jforum.net by adadasfsf]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Supernus wrote:Hi All,

I would like to integrate the same functionality. I played around with the <match> tag in bb_code config file. but I couldnt able to render the image of the link. Is that possible for anyone to explain in more detail.


Thanks in advance

Cheers


Please put here the bb_config.xml portion you tried to use.

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi all,

Thanks for the reply. The following is what I have tried,

<match name="video" removeQuotes="true">
<regex>(?i)\[url\](.*?)\[/url\]</regex>
<replace>
<![CDATA[ <br /> <object width="425" height ="350"> <br /> <param name="movie" value ='$1'></param> <br /> <param name="wmode" value ="transparent"></param> <br /> <embed src='$1' type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed> <br /> </object> <br /> ]]>
</replace>
</match>


If this is not what I should do could you please advice me on how to proceed and what exactly I should follow.

Many Thanks
[originally posted on jforum.net by Supernus]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Try changing:



to



This should allow postings to use a new BB Code like:



[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi

Many thanks for the reply. I tried that but it is not working. It displays the [video] tag along with the link.

cheers
[originally posted on jforum.net by Supernus]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hmm, this works fine on my reference install. Did you remember to go to the admin screen / cache screen and reload the bbcode cache? Or alternatively, restart your application?

Also, the value of the URL probably has to be a valid media type that your browser has a plug in for. E.g. .wmv, .mpg, and the like.
[originally posted on jforum.net by monroe]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
The BB Code for youtube is as follows:


Usage:

See http://www.andowson.com/posts/list/110.page for Live demo
[originally posted on jforum.net by andowson]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Displaying and running a video in JForum
 
Similar Threads
Video Resize API
Should I take this job offer? How good is this?
URLClaasloading in Applet
SCJP 1.4 passed with 95%
Anonymous Polls - How do?