mmorpgforum.net

mmorpgforum.net (https://www.mmorpgforum.net/index.php)
-   Movie Making (https://www.mmorpgforum.net/forumdisplay.php?f=145)
-   -   How To Embed WarcraftMovies.com into webpage (https://www.mmorpgforum.net/showthread.php?t=204851)

dcwarcraft 06-16-2011 11:12 PM

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

Lenwë Sáralondë 06-19-2011 02:38 PM

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.

dcwarcraft 06-19-2011 02:44 PM

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

Lenwë Sáralondë 06-19-2011 04:30 PM

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.

dcwarcraft 06-19-2011 05:55 PM

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 06-21-2011 02:34 AM

We got it working...

Thanks!

http://www.efhguild.com/media

Chog'all video is hosted by warcraftmovies

Ellend 01-14-2012 07:51 PM

Im sorry for dumping old post but any idea how to do it on vBulletin?


Forum time (GMT) 05:17 PM

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