WCM Network: 
 


Go Back   mmorpgforum.net > Machinima > WarcraftMovies.com > Movie Making
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 06-17-2011, 12:12 AM   #1
dcwarcraft
Initiate
 
Join Date: Apr 2011
Posts: 5
dcwarcraft is an unknown quantity at this point
How To Embed WarcraftMovies.com into webpage

My website admin is trying to figure out how to imbed movies we upload to WarcraftMovies.com into our website. With youtube, he has no issue.

We prefer to upload our content here, can anyone tell us how to imbed movies from warcraftmovies.com to our website? Or if you know a website that is already doing this post the link so we can deconstruct the site and see how they did it.

Here's our movie page:
http://www.efhguild.com/media

Thanks
dcwarcraft is offline   Reply With Quote
Old 06-19-2011, 03:38 PM   #2
Lenwë Sáralondë
Initiate
 
Join Date: Jun 2011
Posts: 2
Lenwë Sáralondë is unknown at this point
Up, is there a clean way to do this ?
I'm making a forum and using a simple [video] tag that supports many hosts (YouTube, Dailymotion etc) and I want to add WCM support since it's a reference for WoW videos.

Actually, I'm grabbing the SWF file by loading the web page and just building the object tag.
Lenwë Sáralondë is offline   Reply With Quote
Old 06-19-2011, 03:44 PM   #3
dcwarcraft
Initiate
 
Join Date: Apr 2011
Posts: 5
dcwarcraft is an unknown quantity at this point
The lack of response tells me embedding the flash player used here is not possible. I have yet to find another wow guild's website using embedding warcraftmovies videos.

If I am wrong please post here. Would love to be able to do this.
Youtube has so many restrictions on music content and blimp.tv seems to reduce the quality of the video. I uploaded the same video to both websites and the one on warcraft movies is much clearer....

Anyone else know a video host that has no music restrictions, but will host at 1080p for free?

Thanks
dcwarcraft is offline   Reply With Quote
Old 06-19-2011, 05:30 PM   #4
Lenwë Sáralondë
Initiate
 
Join Date: Jun 2011
Posts: 2
Lenwë Sáralondë is unknown at this point
Okay, I finally managed to do it.

Easy way: To insert just one specific video to any web page, just copy/paste the code from the WCM page. Add FlashVars "autostart=false" to prevent the video to play automatically.

Example with this video http://www.warcraftmovies.com/movieview.php?id=190731 :
HTML Code:
<object width="685" height="386">
	<param name="movie" value="http://embed.minoto-video.com/42/yo6x6NZPdMxr" />
	<param name="allowFullScreen" value="true" />
	<param name="allowscriptaccess" value="always" />
	<param value="autostart=false" name="FlashVars" />
	<embed FlashVars="autostart=false" src="http://embed.minoto-video.com/42/yo6x6NZPdMxr" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" wmode="transparent" width="685" height="386" />
</object>
Just use "show source" to get the mvie URL.

Hard way: Embedded player from the WCM URL using PHP. This what I used for my future PHPBB3 forum, to implement a generic [video] tag supporting various video hosts.

First of all, you must get the Minito video ID from the web page HTML.

PHP Code:
/**
 * Return the specs of the video from its URL
 * 
 * @param string $url
 * @param string $type
 * @param string $id
 * @param int    $width
 * @param int    $height 
 * @return boolean true if the video type has been recognized
 */
function detect_video_specs($url, &$type, &$id, &$width, &$height)
{    
    
$parsedUrl parse_url($url);
    
    
$queryParams = array();
    
    if (!empty(
$parsedUrl['query']))
        
parse_str($parsedUrl['query'], $queryParams);
    
    
$type   null;
    
$id     null;
    
$width  null;
    
$height null;    
    
    
// Warcraft movies
    
if (preg_match('/^(www\.)?warcraftmovies\.com$/i'$parsedUrl['host']) &&
             
preg_match('/^\/movieview\.php$/i'$parsedUrl['path']) && 
                    !empty(
$queryParams['id']))
    {
        
// Grab the SWF
        
$doc = new DOMDocument();
        if (!@
$doc->loadHTMLFile($url))
            return 
false;
        
        
$xPath = new DOMXpath($doc);
        
        
$mainContainer $doc->getElementById('content3');
        if (empty(
$mainContainer))
            return 
false;
        
        
$objects $mainContainer->getElementsByTagName('embed');
        if (
$objects->length == 0)
            return 
false;
        
        
$object $objects->item(0);
        
        
$type   'wcm';
        
$width  = (int) $object->getAttribute('width');
        
$height = (int) $object->getAttribute('height');
        
$id     str_replace('http://embed.minoto-video.com/42/'''$object->getAttribute('src'));
        
//$width  = 560;
        //$height = 315;
        
        
return true;
    }    
    
// You can implement other video platforms here        
    
    
return false;

If the function returns true, your URL has been identified as a WCM video.

Notice that this script is querying the WCM website, it may return false if WCM is down. Once you have the Minoto ID, width and height, you'll need to cache them (ie in DB or in the code of your post if you are editing a forum). It's a waste of time (and resources) to do this at every page display.

You now have the Minoto ID, the width and height. You just need to craft the embedded player code

PHP Code:
    // Load $type, $id, $width and $height from DB cache
    // If no data in cache, get them by calling the function below and store them
    
detect_video_specs($url$type$id$width$height);
            
    switch(
$type)
    {            
        case 
'wcm':
            return 
'<object width="' $width '" height="' $height '"><param value="http://embed.minoto-video.com/42/' $id '" name="movie">'.
                   
'  <param value="true" name="allowFullScreen" />'.
                   
'  <param value="always" name="allowscriptaccess" />'.
                   
'  <param value="autostart=false" name="FlashVars" />'.
                   
'  <embed width="' $width '" height="' $height '" FlashVars="autostart=false" wmode="transparent" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash" src="http://embed.minoto-video.com/42/' $id '">'.
                   
'</object>';            
                
        default:
    } 
"42" seems to be the WCM account id on Minoto.

Last edited by Lenwë Sáralondë : 06-19-2011 at 05:36 PM.
Lenwë Sáralondë is offline   Reply With Quote
Old 06-19-2011, 06:55 PM   #5
dcwarcraft
Initiate
 
Join Date: Apr 2011
Posts: 5
dcwarcraft is an unknown quantity at this point
Lenwë Sáralondë - Sweet. Thanks I will have our web admin take a look at this. Appreciate the time taken to do the response....

DC
dcwarcraft is offline   Reply With Quote
Old 06-21-2011, 03:34 AM   #6
dcwarcraft
Initiate
 
Join Date: Apr 2011
Posts: 5
dcwarcraft is an unknown quantity at this point
We got it working...

Thanks!

http://www.efhguild.com/media

Chog'all video is hosted by warcraftmovies
dcwarcraft is offline   Reply With Quote
Old 01-14-2012, 08:51 PM   #7
Ellend
Initiate
 
Join Date: Jan 2012
Posts: 1
Ellend is unknown at this point
Im sorry for dumping old post but any idea how to do it on vBulletin?
Ellend is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Forum time (GMT) 07:36 PM


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.