• How to add FLV (Flash Video) support 4 0 5 1
Currently:  

Author Topic: How to add FLV (Flash Video) support  (Read 36890 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
How to add FLV (Flash Video) support
« on: January 17, 2009, 02:49:46 AM »
Ok, this question become quiet popular at this forum. So here it is the answer.
In this tutorial we will use free for non-commercial usage JW FLV Media Player v4.3.

1. Go to ACP (Admin Control Panel) -> Settings -> Scroll down and find Valid file extensions, add to the list flv (don't forget put comma). Save the settings.

2. Open includes/upload_definitions.php

Insert at the end of the file, above closing ?>
Code: (PHP) [Select]
$mime_type_match['flv'] = array("application/x-shockwave-flash", "application/octet-stream", "video/flv", "video/x-flv");


3. Create a new template: templates/<your template>/media/flv.html
with this code inside:
Code: (template) [Select]
<script type='text/javascript' src='swfobject.js'></script>
<div id='mediaspace'>This div will be replaced</div>
<script type='text/javascript'>
  var s1 = new SWFObject('player.swf','ply','470','320','9','#ffffff');
  s1.addParam('allowfullscreen','true');
  s1.addParam('allowscriptaccess','always');
  s1.addParam('wmode','opaque');
  s1.addParam('flashvars','file=<?=urlencode("{media_src}")?>&autostart=true');
  s1.write('mediaspace');
</script>

4. Download the player from the link above.
NOTE At the time this tutorial is written the player's download page has "Include the JW Viral Plugin" checkbox, when checked, the downloaded package will have player-viral.swf file, instead of player.swf.
In this tutorial we'll use JW FLV Media Player 4.3 without the "JW Viral plugin" (checkbox at download page must be unchecked).

From the downloaded package take only player.swf and swfobject.js, upload them to the root of your 4images gallery (this is important, in my tests it didn't work when I uploaded these files into a subdirectory).

5. Create an templates/<your template>/icons/flv.gif icon (this icon will be showed when no thumbnail available)

6. Try upload a .flv file, if you get an error about Invalid file type, follow this instructions
« Last Edit: February 18, 2009, 11:56:38 PM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)