Commit bd1d1eb1 authored by Bastien Nocera's avatar Bastien Nocera

browser-plugin: Add new Vegas plugin

Disabled by default.

This plugin uses totem-pl-parser's quvi front-end to grab
a real video URL for a particular embedded object.

This allows playback without Flash for a number of popular video
websites. Note that Totem doesn't contain any code specific to
particular websites, as all the work is done in quvi's scripts.
parent aaf9c819
......@@ -173,6 +173,27 @@ libtotem_narrowspace_plugin_la_LIBADD = $(plugin_libadd)
libtotem_narrowspace_plugin_la_LDFLAGS = $(plugin_ldflags)
endif
# Totem Vegas Plugin
if ENABLE_VEGAS_PLUGIN
plugin_LTLIBRARIES += libtotem-vegas-plugin.la
libtotem_vegas_plugin_la_SOURCES = \
$(plugin_sources) \
totemVegasPlugin.cpp \
totemVegasPlugin.h
libtotem_vegas_plugin_la_CPPFLAGS = \
-DXP_UNIX \
-DMOZ_X11 \
-DTOTEM_VEGAS_PLUGIN \
-DTOTEM_PL_PARSER_MINI \
$(AM_CPPFLAGS)
libtotem_vegas_plugin_la_CXXFLAGS = $(plugin_cxxflags)
libtotem_vegas_plugin_la_LIBADD = $(plugin_libadd)
libtotem_vegas_plugin_la_LDFLAGS = $(plugin_ldflags)
endif
# Totem MULLY Plugin
if ENABLE_MULLY_PLUGIN
plugin_LTLIBRARIES += libtotem-mully-plugin.la
......
......@@ -78,6 +78,7 @@ typedef enum {
TOTEM_PLUGIN_TYPE_NARROWSPACE,
TOTEM_PLUGIN_TYPE_MULLY,
TOTEM_PLUGIN_TYPE_CONE,
TOTEM_PLUGIN_TYPE_VEGAS,
TOTEM_PLUGIN_TYPE_LAST
} TotemPluginType;
......@@ -2175,7 +2176,8 @@ parse_plugin_type (const gchar *option_name,
"gmp",
"narrowspace",
"mully",
"cone"
"cone",
"vegas"
};
TotemPluginType type;
......
......@@ -74,6 +74,8 @@
#include "totemConePlaylist.h"
#include "totemConePlaylistItems.h"
#include "totemConeVideo.h"
#elif defined(TOTEM_VEGAS_PLUGIN)
#include "totemVegasPlugin.h"
#else
#error Unknown plugin type
#endif
......@@ -105,6 +107,8 @@ static const totemPluginMimeEntry kMimeTypes[] = {
{ "image/x-quicktime", "pict, pict1, pict2", "image/x-pict" },
{ "video/x-m4v", "m4v", NULL },
{ "application/vnd.apple.mpegurl", "m3u8", NULL },
#elif defined(TOTEM_VEGAS_PLUGIN)
{ "application/x-shockwave-flash", "swf", "Shockwave Flash" },
#elif defined(TOTEM_MULLY_PLUGIN)
{ "video/divx", "divx", "video/x-msvideo" },
#elif defined(TOTEM_CONE_PLUGIN)
......@@ -139,6 +143,8 @@ static const char kPluginDescription[] =
"Windows Media Player Plug-in 10 (compatible; Totem)";
#elif defined(TOTEM_NARROWSPACE_PLUGIN)
"QuickTime Plug-in " TOTEM_NARROWSPACE_VERSION;
#elif defined(TOTEM_VEGAS_PLUGIN)
"Shockwave Flash";
#elif defined(TOTEM_MULLY_PLUGIN)
"DivX\xC2\xAE Web Player";
#elif defined(TOTEM_CONE_PLUGIN)
......@@ -150,6 +156,8 @@ static const char kPluginDescription[] =
static const char kPluginLongDescription[] =
#if defined(TOTEM_MULLY_PLUGIN)
"DivX Web Player version " TOTEM_MULLY_VERSION;
#elif defined(TOTEM_VEGAS_PLUGIN)
"Shockwave Flash 11.1 r102";
#else
"The <a href=\"http://www.gnome.org/projects/totem/\">Totem</a> " PACKAGE_VERSION " plugin handles video and audio streams.";
#endif
......@@ -525,6 +533,8 @@ totemPlugin::ViewerFork ()
g_ptr_array_add (arr, g_strdup ("mully"));
#elif defined(TOTEM_CONE_PLUGIN)
g_ptr_array_add (arr, g_strdup ("cone"));
#elif defined(TOTEM_VEGAS_PLUGIN)
g_ptr_array_add (arr, g_strdup ("vegas"));
#else
#error Unknown plugin type
#endif
......@@ -2012,6 +2022,22 @@ totemPlugin::Init (NPMIMEType mimetype,
}
#endif /* TOTEM_CONE_PLUGIN */
#ifdef TOTEM_VEGAS_PLUGIN
/* Never try to load the SWF file */
SetSrc ("");
if (totem_pl_parser_can_parse_from_uri (mDocumentURI, TRUE)) {
value = (const char *) g_hash_table_lookup (args, "flashvars");
if (value != NULL) {
TotemQueueCommand *cmd;
cmd = g_new0 (TotemQueueCommand, 1);
cmd->type = TOTEM_QUEUE_TYPE_SET_PLAYLIST;
cmd->string = g_strdup (mDocumentURI);
QueueCommand (cmd);
}
}
#endif
#if 0 //def TOTEM_MULLY_PLUGIN
/* Click to play behaviour of the DivX plugin */
char *previewimage = (const char *) g_hash_table_lookup (args, "previewimage");
......@@ -2544,6 +2570,8 @@ totemPlugin::GetNPObject (ObjectEnum which)
npclass = totemNarrowSpacePlayerNPClass::Instance();
#elif defined(TOTEM_MULLY_PLUGIN)
npclass = totemMullYPlayerNPClass::Instance();
#elif defined(TOTEM_VEGAS_PLUGIN)
npclass = totemVegasPlayerNPClass::Instance();
#elif defined(TOTEM_CONE_PLUGIN)
switch (which) {
case ePluginScriptable:
......@@ -2623,6 +2651,8 @@ totemPlugin::Shutdown ()
totemConePlaylistNPClass::Shutdown ();
totemConePlaylistItemsNPClass::Shutdown ();
totemConeVideoNPClass::Shutdown ();
#elif defined(TOTEM_VEGAS_PLUGIN)
totemVegasPlayerNPClass::Shutdown ();
#else
#error Unknown plugin type
#endif
......
/* Totem Vegas Plugin
*
* Copyright © 2011 Bastien Nocera <hadess@hadess.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#include <config.h>
#include "totemPlugin.h"
#include "totemVegasPlugin.h"
static const char *methodNames[] = {
};
TOTEM_IMPLEMENT_NPCLASS (totemVegasPlayer,
NULL, 0,
methodNames, G_N_ELEMENTS (methodNames),
NULL);
totemVegasPlayer::totemVegasPlayer (NPP aNPP)
: totemNPObject (aNPP)
{
TOTEM_LOG_CTOR ();
}
totemVegasPlayer::~totemVegasPlayer ()
{
TOTEM_LOG_DTOR ();
}
bool
totemVegasPlayer::InvokeByIndex (int aIndex,
const NPVariant *argv,
uint32_t argc,
NPVariant *_result)
{
TOTEM_LOG_INVOKE (aIndex, totemVegasPlayer);
return false;
}
/* Totem Vegas plugin scriptable
*
* Copyright © 2011 Bastien Nocera <hadess@hadess.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*/
#ifndef __VEGAS_PLUGIN_H__
#define __VEGAS_PLUGIN_H__
#include "totemNPClass.h"
#include "totemNPObject.h"
class totemVegasPlayer : public totemNPObject
{
public:
totemVegasPlayer (NPP);
virtual ~totemVegasPlayer ();
enum PluginState {
};
PluginState mPluginState;
private:
enum Methods {
};
virtual bool InvokeByIndex (int aIndex, const NPVariant *argv, uint32_t argc, NPVariant *_result);
};
TOTEM_DEFINE_NPCLASS (totemVegasPlayer);
#endif /* __VEGAS_PLUGIN_H__ */
......@@ -621,12 +621,19 @@ AC_ARG_ENABLE([cone-plugin],
[],[enable_cone_plugin=yes])
AC_MSG_RESULT([$enable_cone_plugin])
AC_MSG_CHECKING([whether to enable the Vegas browser plugin])
AC_ARG_ENABLE([vegas-plugin],
AS_HELP_STRING([--enable-vegas-plugin],[Whether to enable the Vegas browser plugin]),
[enable_vegas_plugin=yes],[enable_vegas_plugin=no])
AC_MSG_RESULT([$enable_vegas_plugin])
fi
AM_CONDITIONAL([ENABLE_GMP_PLUGIN],[test "$enable_gmp_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_NARROWSPACE_PLUGIN],[test "$enable_narrowspace_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_MULLY_PLUGIN],[test "$enable_mully_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_CONE_PLUGIN],[test "$enable_cone_plugin" = "yes"])
AM_CONDITIONAL([ENABLE_VEGAS_PLUGIN],[test "$enable_vegas_plugin" = "yes"])
dnl ********
dnl Nautilus
......@@ -831,6 +838,11 @@ if test x$enable_browser_plugins = xyes ; then
else
AC_MSG_NOTICE([ Cone (VLC) plugin disabled])
fi
if test x$enable_vegas_plugin = xyes ; then
AC_MSG_NOTICE([** Vegas (Flash) plugin enabled])
else
AC_MSG_NOTICE([ Vegas (Flash) plugin disabled])
fi
else
AC_MSG_NOTICE([ Browser plugin disabled])
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment