PDA

Zobacz pełną wersję : Problem z jVideoDirect!



dzumaclan
24-01-2010, 12:14
Znalazłem potrzebny mi dodatek na:
http://extensions.joomla.org/extensions/multimedia/video-players-a-gallery/9501
w opisie jego pisze że można wstawiać przez niego filmy z youtuba,googla itp. itd. mnie interesowało jednak bym mógł dodawać filmiki z megavideo...
niby w opisie było napisane że posiadamy taką możliwość lecz po instalacji tego modułu w pluginsach nie ma mam możliwość jedynie dodania filmu z :
youtube
google
w katalogu plugins są tylko te 2 wyżej więc trzeba samemu napisać plugina do megavideo a później następnie go dodać, i tu tkwi mój problem czy ktoś mógłby napisać plugina do megavideo czy to dla własnej satysfakcji czy tam za przysłowiowo małą sumkę bo dużo roboty z tym nie ma.. podam nawet plugin z googla i youtube na którym można się wzorować:

google:


<?php
/**
* @package jVideoDirect components, modules, plugins for Joomla
* @subpackage
* @copyright Copyright (C) 2009 jVideoDirect.com. All rights reserved.
* @contact cs@jvideodirect.com
* @license GPLv3 http://www.gnu.org/licenses/gpl.html
* jVideoDirect is free software. This version may have been modified pursuant to the
* GPLv3, and as distributed it includes or is derivative
* of works licensed under the GPLv3 or other free or open
* source software licenses.
*/

// support download & linkage & in-player
class google {
function tools() {
$base = dirname(__file__);
require_once($base.'/../../classes/simple_html_dom.php');
require_once($base.'/../../classes/Snoopy.class.php');
}
// Video Info Call
function fetchDetail($op) {
$this->tools();
$vid = null; $thumbnail = null; $ob = null; $ob1 = null; $url = null; $remote->error = false;
$pos = strpos($op, "videoplay?docid=");
if ($pos) {
$pattern = '#docid=([0-9_-]+)#';
if (preg_match($pattern,$op,$matches)) {
$vid = $matches[1];
}
} else {
$remote->error = true;
}
if (isset($vid)) {
$url = 'http://video.google.com/videoplay?docid='.$vid;
$url1 = 'http://video.google.com/videofeed?docid='.$vid;
$mySnoopy = new Snoopy;
$mySnoopy->fetch($url);
$ob = $mySnoopy->results;
$ob = urldecode($ob);
$ob1 = @file_get_html($url1);
if (is_object($ob1)) {
$thumbnail = $ob1->find("media:thumbnail", 0)->url;
} else {
$pos_s = strpos($ob, 'x26thumbnailUrl\x3d') + 19;
$pos_e = strpos($ob, '&sigh=', $pos_s);
$thumbnail = substr($ob, $pos_s, $pos_e - $pos_s);
}
}
if ($ob) {
preg_match('/<title>(.*?)<\/title>/', $ob, $matches);
$remote->title = $matches[1];

if (strstr($ob,'<span id=long-desc-content>')) {
$pos_s = strpos($ob, '<span id=long-desc-content>') + 27;
$pos_e = strpos($ob, '</span>', $pos_s);
$getdesc = substr($ob, $pos_s, $pos_e - $pos_s);
$remote->desc = (!$getdesc) ? "Unknown" : $getdesc;
} elseif (is_object($ob1)) {
$getdesc = $ob1->find("media:description", 0);
$remote->desc = $getdesc->innertext;
}
if (is_object($ob1)) {
$remote->vlengthsec = $ob1->find("media:content", 0)->duration;
} else {
$pos_s = strpos($ob, 'duration:\'') + 27;
$pos_e = strpos($ob, '\',', $pos_s);
$remote->vlengthsec = substr($ob, $pos_s, $pos_e - $pos_s);
}

$hq = strstr($ob,'right-click <a href=');
$remote->hd = ($hq) ? 1 : 0 ;
$remote->tags = '';
$remote->grab = 0;
$remote->rid = $vid;
$remote->wide = 0;
} else { $remote->error = true; }

$remote->title = (isset($remote->title)) ? trim(strip_tags($remote->title)) : 'unknown';
$remote->desc = (isset($remote->desc)) ? trim(strip_tags($remote->desc)): 'unknown';
$remote->tags = (isset($remote->tags)) ? trim(strip_tags($remote->tags)): '';
$remote->thumbnail = trim(strip_tags($thumbnail));
if ($remote->thumbnail == null) { $remote->error = true; }
$remote->url = $url;
$remote->vid = $vid;
// return title, description, tags, thumbnail url, url, video id, vlengthsec, hd,wide,grab;
return $remote;

}

// Video Grab Link
function fetchURL($url) {
$this->tools();
$ret = false;
$url = $url.'&';
$pattern = '/docid=(.*?)&/';
preg_match($pattern, $url, $matches);
$video_id = $matches[1];

$url = "http://video.google.com/videoplay?docid=".$video_id;
$mySnoopy = new Snoopy;
$mySnoopy->fetch($url);
$data = $mySnoopy->results;

if (preg_match('/right-click <a href=(.*?)>this link/', $data, $matches)) {
$ret[0]->url = $matches[1];
$ret[0]->ext = 'mp4';
} else {
if (preg_match("/googleplayer.swf\?videoUrl\\x3d(.*?)\\x26/", $data, $matches)) {
$ret[0]->url = urldecode($matches[1]);
$ret[0]->ext = 'flv';
}
}
return $ret;
}

function fetchLink($v, $hd = false) { // $x->ext, $x->url, $x->embed
$this->tools();
$info = explode(',',$v);
//thumbnail url
$url1 = "http://video.google.com/videofeed?docid=".$info[1];
$ob1 = file_get_html($url1);
$ret->url = $ob1->find("media:thumbnail", 0)->url;
$ret->url = str_replace('amp;', '', $ret->url);
if ($ret->url == null) {
$url = 'http://video.google.com/videoplay?docid='.$info[1];
$mySnoopy = new Snoopy;
$mySnoopy->fetch($url);
$ob = $mySnoopy->results;
$ob = urldecode($ob);
$pos_s = strpos($ob, 'x26thumbnailUrl\x3d') + 19;
$pos_e = strpos($ob, '&sigh=', $pos_s);
$ret->url = substr($ob, $pos_s, $pos_e - $pos_s);
}
$ret->ext = 'jpg';
//embed url
$info[] = 'http://video.google.com/googleplayer.swf?docId='.$info[1].'&hl=en';
$info[] = $info[2];
$ret->info = implode('|^|',$info);

return $ret;
// [0] domain
// [1] remote id
// [2] remoteUrl
// [3] embedurl
// [4] embedurltoflvplayer
// [5] width
// [6] height
}
}
youtube:
http://dcservices.nazwa.pl/Nowy%20Dokument%20tekstowy.txt

liczę na pomoc sam próbowałem i nic z tego nie wyszło
Pozdrawiam

neo_fox
24-01-2010, 12:24
A to: http://jvideodirect.com/forum/19-modules-a-plugins/1370-not-able-to-fetch-video-from-other-platforms#1372 czytałeś?

Pozdrawiam,
Radek

asdfg123
22-03-2010, 23:09
Wiem jak to zrobić jak Cię interesuje. Zapraszam na PW.