Commit e10d4311 authored by Antoine Cellerier's avatar Antoine Cellerier

Port the http interface to the Lua Interface Module framework.

 * share/luaintf/http.lua: Equivalent of the legacy modules/control/http/
   module. (The new module takes 272 lines of Lua, instead of 5475 lines for
   the old one.) Functionality is basically the same except for CGI support
   which is missing.
 * share/http-lua/: The HTML files using the new <?vlc [lua code] ?> syntax.
 * modules/misc/lua/: Add Lua bindings for a few VLC function, the most
   important being the HTTPd high level functions, ACLs, stat and opendir.

The Lua code still needs to be cleaned up a bit.
parent 050188ce
......@@ -441,6 +441,38 @@ VLC-release.app: vlc
for i in $(srcdir)/share/luaintf/modules/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/luaintf/modules/`basename $${i}` ; \
done ; \
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/dialogs
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/js
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old/admin
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old/vlm
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/images
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/requests
for i in $(srcdir)/share/http-lua/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/dialogs/* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/dialogs/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/js/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/js/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/old/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/old/admin/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old/admin/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/old/vlm/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/old/vlm/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/images/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/images/`basename $${i}` ; \
done ; \
for i in $(srcdir)/share/http-lua/requests/*.* ; do \
$(INSTALL) -m 644 $${i} $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/requests/`basename $${i}` ; \
done ; \
$(INSTALL) -m 644 $(srcdir)/share/http-lua/requests/readme $(top_builddir)/VLC-release.app/Contents/MacOS/share/http-lua/requests/readme.txt
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/dialogs
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/js
$(INSTALL) -d $(top_builddir)/VLC-release.app/Contents/MacOS/share/http/old
......@@ -646,6 +678,43 @@ package-win-common:
|| true ; \
done
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/images"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/requests"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/js"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/dialogs"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/old"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/old/vlm"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http-lua/old/admin"
cp $(srcdir)/share/http-lua/*.html $(top_builddir)/vlc-${VERSION}/http-lua/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/*.html ;
cp $(srcdir)/share/http-lua/.hosts $(top_builddir)/vlc-${VERSION}/http-lua/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/.hosts ;
cp $(srcdir)/share/http-lua/*.css $(top_builddir)/vlc-${VERSION}/http-lua/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/*.css ;
cp $(srcdir)/share/http-lua/js/*.js $(top_builddir)/vlc-${VERSION}/http-lua/js/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/js/*.js ;
cp $(srcdir)/share/http-lua/dialogs/* $(top_builddir)/vlc-${VERSION}/http-lua/dialogs/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/dialogs/* ;
cp $(srcdir)/share/http-lua/dialogs/.hosts $(top_builddir)/vlc-${VERSION}/http-lua/dialogs/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/dialogs/.hosts ;
cp $(srcdir)/share/http-lua/*.ico $(top_builddir)/vlc-${VERSION}/http-lua/ ;
cp $(srcdir)/share/http-lua/images/*.png $(top_builddir)/vlc-${VERSION}/http-lua/images/
cp $(srcdir)/share/http-lua/requests/*.xml $(top_builddir)/vlc-${VERSION}/http-lua/requests/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/requests/*.xml ;
cp $(srcdir)/share/http-lua/requests/readme $(top_builddir)/vlc-${VERSION}/http-lua/requests/readme.txt ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/requests/readme.txt ;
cp $(srcdir)/share/http-lua/old/*.html $(top_builddir)/vlc-${VERSION}/http-lua/old/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/old/*.html ;
cp $(srcdir)/share/http-lua/old/*.css $(top_builddir)/vlc-${VERSION}/http-lua/old/ ;
cp $(srcdir)/share/http-lua/old/.hosts $(top_builddir)/vlc-${VERSION}/http-lua/old/ ;
cp $(srcdir)/share/http-lua/old/*.png $(top_builddir)/vlc-${VERSION}/http-lua/old/ ;
cp $(srcdir)/share/http-lua/old/vlm/*.html $(top_builddir)/vlc-${VERSION}/http-lua/old/vlm/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/old/vlm/*.html ;
cp $(srcdir)/share/http-lua/old/admin/*.html $(top_builddir)/vlc-${VERSION}/http-lua/old/admin/ ;
unix2dos $(top_builddir)/vlc-${VERSION}/http-lua/old/admin/*.html ;
cp $(srcdir)/share/http-lua/old/admin/.access $(top_builddir)/vlc-${VERSION}/http-lua/old/admin/ ;
mkdir -p "$(top_builddir)/vlc-${VERSION}/http/images"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http/requests"
mkdir -p "$(top_builddir)/vlc-${VERSION}/http/js"
......
SOURCES_lua = playlist.c meta.c intf.c vlc.c vlc.h callbacks.c objects.c variables.c configuration.c net.c vlm.c
SOURCES_lua = playlist.c meta.c intf.c vlc.c vlc.h callbacks.c objects.c variables.c configuration.c net.c vlm.c httpd.c acl.c
/*****************************************************************************
* acl.c: Access list related functions
*****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea at videolan tod org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include <vlc/vlc.h>
#include <vlc_acl.h>
#include <lua.h> /* Low level lua C API */
#include <lauxlib.h> /* Higher level C API */
#include <lualib.h> /* Lua libs */
#include "vlc.h"
/*****************************************************************************
*
*****************************************************************************/
int vlclua_acl_create( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_bool_t b_allow = luaL_checkboolean( L, 1 ) ? VLC_TRUE : VLC_FALSE;
vlc_acl_t *p_acl = ACL_Create( p_this, b_allow );
if( !p_acl )
return luaL_error( L, "ACL creation failed." );
lua_pushlightuserdata( L, p_acl ); /* FIXME */
return 1;
}
int vlclua_acl_delete( lua_State *L )
{
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
ACL_Destroy( p_acl );
return 0;
}
int vlclua_acl_check( lua_State *L )
{
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
const char *psz_ip = luaL_checkstring( L, 2 );
lua_pushinteger( L, ACL_Check( p_acl, psz_ip ) );
return 1;
}
int vlclua_acl_duplicate( lua_State *L )
{
vlc_object_t *p_this = vlclua_get_this( L );
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
vlc_acl_t *p_acl_new = ACL_Duplicate( p_this, p_acl );
lua_pushlightuserdata( L, p_acl_new );
return 1;
}
int vlclua_acl_add_host( lua_State *L )
{
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
const char *psz_ip = luaL_checkstring( L, 2 );
vlc_bool_t b_allow = luaL_checkboolean( L, 3 ) ? VLC_TRUE : VLC_FALSE;
lua_pushinteger( L, ACL_AddHost( p_acl, psz_ip, b_allow ) );
return 1;
}
int vlclua_acl_add_net( lua_State *L )
{
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
const char *psz_ip = luaL_checkstring( L, 2 );
int i_len = luaL_checkint( L, 3 );
vlc_bool_t b_allow = luaL_checkboolean( L, 4 ) ? VLC_TRUE : VLC_FALSE;
lua_pushinteger( L, ACL_AddNet( p_acl, psz_ip, i_len, b_allow ) );
return 1;
}
int vlclua_acl_load_file( lua_State *L )
{
vlc_acl_t *p_acl = (vlc_acl_t*)luaL_checklightuserdata( L, 1 );
const char *psz_path = luaL_checkstring( L, 2 );
lua_pushinteger( L, ACL_LoadFile( p_acl, psz_path ) );
return 1;
}
......@@ -159,7 +159,7 @@ int vlclua_add_callback( lua_State *L )
* the function in the stack to nil) */
p_callback->i_index = i_index;
p_callback->i_type = var_Type( p_obj, psz_var );
p_callback->L = lua_newthread( L );
p_callback->L = lua_newthread( L ); /* Do we have to keep a reference to this thread somewhere to prevent garbage collection? */
var_AddCallback( p_obj, psz_var, vlclua_callback, p_callback );
return 0;
......
This diff is collapsed.
......@@ -122,7 +122,7 @@ static int vlclua_input_info( lua_State *L )
int i_cat;
int i;
if( !p_input ) return vlclua_error( L );
vlc_mutex_lock( &input_GetItem(p_input)->lock );
//vlc_mutex_lock( &input_GetItem(p_input)->lock );
i_cat = input_GetItem(p_input)->i_categories;
lua_createtable( L, 0, i_cat );
for( i = 0; i < i_cat; i++ )
......@@ -141,7 +141,7 @@ static int vlclua_input_info( lua_State *L )
}
lua_settable( L, -3 );
}
vlc_object_release( p_input );
//vlc_object_release( p_input );
return 1;
}
......@@ -165,6 +165,36 @@ static int vlclua_get_title( lua_State *L )
return 1;
}
static int vlclua_input_stats( lua_State *L )
{
input_thread_t *p_input = vlclua_get_input_internal( L );
input_item_t *p_item = p_input && p_input->p ? input_GetItem( p_input ) : NULL;
lua_newtable( L );
if( p_item )
{
#define STATS_INT( n ) lua_pushinteger( L, p_item->p_stats->i_ ## n ); \
lua_setfield( L, -2, #n );
#define STATS_FLOAT( n ) lua_pushnumber( L, p_item->p_stats->f_ ## n ); \
lua_setfield( L, -2, #n );
STATS_INT( read_bytes )
STATS_FLOAT( input_bitrate )
STATS_INT( demux_read_bytes )
STATS_FLOAT( demux_bitrate )
STATS_INT( decoded_video )
STATS_INT( displayed_pictures )
STATS_INT( lost_pictures )
STATS_INT( decoded_audio )
STATS_INT( played_abuffers )
STATS_INT( lost_abuffers )
STATS_INT( sent_packets )
STATS_INT( sent_bytes )
STATS_FLOAT( send_bitrate )
#undef STATS_INT
#undef STATS_FLOAT
}
return 1;
}
/*****************************************************************************
* Vout control
*****************************************************************************/
......@@ -454,7 +484,10 @@ static int vlclua_playlist_get( lua_State *L )
lua_setfield( L, -2, "name" );
lua_pushstring( L, p_input->psz_uri );
lua_setfield( L, -2, "path" );
lua_pushnumber( L, ((double)p_input->i_duration)*1e-6 );
if( p_input->i_duration < 0 )
lua_pushnumber( L, -1 );
else
lua_pushnumber( L, ((double)p_input->i_duration)*1e-6 );
lua_setfield( L, -2, "duration" );
lua_pushinteger( L, p_input->i_nb_played );
lua_setfield( L, -2, "nb_played" );
......@@ -476,15 +509,16 @@ static int vlclua_playlist_status( lua_State *L )
{
intf_thread_t *p_intf = (intf_thread_t *)vlclua_get_this( L );
playlist_t *p_playlist = pl_Yield( p_intf );
/*
int i_count = 0;
lua_settop( L, 0 );
lua_settop( L, 0 );*/
if( p_playlist->p_input )
{
char *psz_uri =
/*char *psz_uri =
input_item_GetURI( input_GetItem( p_playlist->p_input ) );
lua_pushstring( L, psz_uri );
free( psz_uri );
lua_pushnumber( L, config_GetInt( p_intf, "volume" ) );
lua_pushnumber( L, config_GetInt( p_intf, "volume" ) );*/
vlc_mutex_lock( &p_playlist->object_lock );
switch( p_playlist->status.i_status )
{
......@@ -492,7 +526,7 @@ static int vlclua_playlist_status( lua_State *L )
lua_pushstring( L, "stopped" );
break;
case PLAYLIST_RUNNING:
lua_pushstring( L, "running" );
lua_pushstring( L, "playing" );
break;
case PLAYLIST_PAUSED:
lua_pushstring( L, "paused" );
......@@ -502,10 +536,14 @@ static int vlclua_playlist_status( lua_State *L )
break;
}
vlc_mutex_unlock( &p_playlist->object_lock );
i_count += 3;
/*i_count += 3;*/
}
else
{
lua_pushstring( L, "stopped" );
}
vlc_object_release( p_playlist );
return i_count;
return 1;
}
......@@ -552,15 +590,23 @@ static luaL_Reg p_reg[] =
{ "decode_uri", vlclua_decode_uri },
{ "resolve_xml_special_chars", vlclua_resolve_xml_special_chars },
{ "convert_xml_special_chars", vlclua_convert_xml_special_chars },
{ "lock_and_wait", vlclua_lock_and_wait },
{ "signal", vlclua_signal },
{ "version", vlclua_version },
{ "license", vlclua_license },
{ "copyright", vlclua_copyright },
{ "should_die", vlclua_intf_should_die },
{ "quit", vlclua_quit },
{ "homedir", vlclua_homedir },
{ "datadir", vlclua_datadir },
{ "configdir", vlclua_configdir },
{ "cachedir", vlclua_cachedir },
{ "datadir_list", vlclua_datadir_list },
{ NULL, NULL }
};
......@@ -620,6 +666,7 @@ static luaL_Reg p_reg_playlist[] =
{ "add", vlclua_playlist_add },
{ "enqueue", vlclua_playlist_enqueue },
{ "get", vlclua_playlist_get },
{ "stats", vlclua_input_stats },
{ NULL, NULL }
};
......@@ -664,6 +711,9 @@ static luaL_Reg p_reg_fd[] =
/* { "open", vlclua_fd_open },*/
{ "read", vlclua_fd_read },
{ "write", vlclua_fd_write },
{ "stat", vlclua_stat },
{ "opendir", vlclua_opendir },
{ "new_fd_set", vlclua_fd_set_new },
{ "fd_clr", vlclua_fd_clr },
......@@ -683,6 +733,32 @@ static luaL_Reg p_reg_vlm[] =
{ NULL, NULL }
};
static luaL_Reg p_reg_httpd[] =
{
{ "host_new", vlclua_httpd_tls_host_new },
{ "host_delete", vlclua_httpd_host_delete },
{ "handler_new", vlclua_httpd_handler_new },
{ "handler_delete", vlclua_httpd_handler_delete },
{ "file_new", vlclua_httpd_file_new },
{ "file_delete", vlclua_httpd_file_delete },
{ "redirect_new", vlclua_httpd_redirect_new },
{ "redirect_delete", vlclua_httpd_redirect_delete },
{ NULL, NULL }
};
static luaL_Reg p_reg_acl[] =
{
{ "create", vlclua_acl_create },
{ "delete", vlclua_acl_delete },
{ "check", vlclua_acl_check },
{ "duplicate", vlclua_acl_duplicate },
{ "add_host", vlclua_acl_add_host },
{ "add_net", vlclua_acl_add_net },
{ "load_file", vlclua_acl_load_file },
{ NULL, NULL }
};
static void Run( intf_thread_t *p_intf );
......@@ -817,6 +893,8 @@ int E_(Open_LuaIntf)( vlc_object_t *p_this )
luaL_register_submodule( L, "net", p_reg_net );
luaL_register_submodule( L, "fd", p_reg_fd );
luaL_register_submodule( L, "vlm", p_reg_vlm );
luaL_register_submodule( L, "httpd", p_reg_httpd );
luaL_register_submodule( L, "acl", p_reg_acl );
/* clean up */
lua_pop( L, 1 );
......
......@@ -205,3 +205,89 @@ int vlclua_fd_read( lua_State *L )
lua_pushlstring( L, psz_buffer, i_len );
return 1;
}
int vlclua_stat( lua_State *L )
{
#ifdef HAVE_SYS_STAT_H
const char *psz_path = luaL_checkstring( L, 1 );
struct stat s;
if( utf8_stat( psz_path, &s ) )
return 0;
//return luaL_error( L, "Couldn't stat %s.", psz_path );
lua_newtable( L );
if( S_ISREG( s.st_mode ) )
lua_pushstring( L, "file" );
else if( S_ISDIR( s.st_mode ) )
lua_pushstring( L, "dir" );
#ifdef S_ISCHR
else if( S_ISCHR( s.st_mode ) )
lua_pushstring( L, "character device" );
#endif
#ifdef S_ISBLK
else if( S_ISBLK( s.st_mode ) )
lua_pushstring( L, "block device" );
#endif
#ifdef S_ISFIFO
else if( S_ISFIFO( s.st_mode ) )
lua_pushstring( L, "fifo" );
#endif
#ifdef S_ISLNK
else if( S_ISLNK( s.st_mode ) )
lua_pushstring( L, "symbolic link" );
#endif
#ifdef S_ISSOCK
else if( S_ISSOCK( s.st_mode ) )
lua_pushstring( L, "socket" );
#endif
else
lua_pushstring( L, "unknown" );
lua_setfield( L, -2, "type" );
lua_pushinteger( L, s.st_mode );
lua_setfield( L, -2, "mode" );
lua_pushinteger( L, s.st_uid );
lua_setfield( L, -2, "uid" );
lua_pushinteger( L, s.st_gid );
lua_setfield( L, -2, "gid" );
lua_pushinteger( L, s.st_size );
lua_setfield( L, -2, "size" );
lua_pushinteger( L, s.st_atime );
lua_setfield( L, -2, "access_time" );
lua_pushinteger( L, s.st_mtime );
lua_setfield( L, -2, "modification_time" );
lua_pushinteger( L, s.st_ctime );
lua_setfield( L, -2, "creation_time" );
return 1;
#else
# warning "Woops, looks like we don't have stat on your platform"
return luaL_error( L, "System is missing <sys/stat.h>" );
#endif
}
int vlclua_opendir( lua_State *L )
{
const char *psz_dir = luaL_checkstring( L, 1 );
DIR *p_dir;
int i = 0;
#ifdef HAVE_SYS_STAT_H
struct stat s;
if( utf8_stat( psz_dir, &s ) == -1 )
return luaL_error( L, "Error while trying to stat `%s'.", psz_dir );
if( !S_ISDIR( s.st_mode ) )
return luaL_error( L, "`%s' is not a directory.", psz_dir );
#endif
if( ( p_dir = utf8_opendir( psz_dir ) ) == NULL )
return luaL_error( L, "cannot open directory `%s'.", psz_dir );
lua_newtable( L );
for( ;; )
{
char *psz_filename = utf8_readdir( p_dir );
if( !psz_filename ) break;
i++;
lua_pushstring( L, psz_filename );
lua_rawseti( L, -2, i );
free( psz_filename );
}
closedir( p_dir );
return 1;
}
......@@ -118,6 +118,15 @@ int vlclua_version( lua_State *L )
return 1;
}
/*****************************************************************************
* Get the VLC copyright
*****************************************************************************/
int vlclua_copyright( lua_State *L )
{
lua_pushstring( L, COPYRIGHT_MESSAGE );
return 1;
}
/*****************************************************************************
* Get the VLC license msg/disclaimer
*****************************************************************************/
......@@ -139,6 +148,49 @@ int vlclua_quit( lua_State *L )
return 0;
}
/*****************************************************************************
* Global properties getters
*****************************************************************************/
int vlclua_datadir( lua_State *L )
{
lua_pushstring( L, config_GetDataDir() );
return 1;
}
int vlclua_homedir( lua_State *L )
{
lua_pushstring( L, vlclua_get_this( L )->p_libvlc->psz_homedir );
return 1;
}
int vlclua_configdir( lua_State *L )
{
lua_pushstring( L, vlclua_get_this( L )->p_libvlc->psz_configdir );
return 1;
}
int vlclua_cachedir( lua_State *L )
{
lua_pushstring( L, vlclua_get_this( L )->p_libvlc->psz_cachedir );
return 1;
}
int vlclua_datadir_list( lua_State *L )
{
const char *psz_dirname = luaL_checkstring( L, 1 );
vlc_object_t *p_this = vlclua_get_this( L );
char *ppsz_dir_list[] = { NULL, NULL, NULL, NULL };
char **ppsz_dir = ppsz_dir_list;
int i = 1;
if( vlclua_dir_list( p_this, psz_dirname, ppsz_dir_list ) != VLC_SUCCESS )
return 0;
lua_newtable( L );
for( ; *ppsz_dir; ppsz_dir++ )
{
lua_pushstring( L, *ppsz_dir );
lua_rawseti( L, -2, i );
i ++;
}
return 1;
}
/*****************************************************************************
* Volume related
*****************************************************************************/
......@@ -275,6 +327,20 @@ int vlclua_resolve_xml_special_chars( lua_State *L )
return i_top;
}
int vlclua_convert_xml_special_chars( lua_State *L )
{
int i_top = lua_gettop( L );
int i;
for( i = 1; i <= i_top; i++ )
{
char *psz_string = convert_xml_special_chars( luaL_checkstring(L,1) );
lua_remove( L, 1 );
lua_pushstring( L, psz_string );
free( psz_string );
}
return i_top;
}
/*****************************************************************************
* Messaging facilities
*****************************************************************************/
......
......@@ -100,6 +100,13 @@ static inline const void *luaL_checkuserdata( lua_State *L, int narg, size_t siz
return lua_topointer( L, narg );
}
static inline const char *luaL_nilorcheckstring( lua_State *L, int narg )
{
if( lua_isnil( L, narg ) )
return NULL;
return luaL_checkstring( L, narg );
}
/*****************************************************************************
* Lua vlc_object_t wrapper
*****************************************************************************/
......@@ -132,10 +139,31 @@ int vlclua_fd_zero( lua_State * );
int vlclua_fd_read( lua_State * );
int vlclua_fd_write( lua_State * );
int vlclua_stat( lua_State * );
int vlclua_opendir( lua_State * );
int vlclua_vlm_new( lua_State * );
int vlclua_vlm_delete( lua_State * );
int vlclua_vlm_execute_command( lua_State * );
int vlclua_httpd_tls_host_new( lua_State *L );
int vlclua_httpd_host_delete( lua_State *L );
int vlclua_httpd_handler_new( lua_State * L );
int vlclua_httpd_handler_delete( lua_State *L );
int vlclua_httpd_file_new( lua_State *L );
int vlclua_httpd_file_delete( lua_State *L );
int vlclua_httpd_redirect_new( lua_State *L );
int vlclua_httpd_redirect_delete( lua_State *L );
int vlclua_acl_create( lua_State * );
int vlclua_acl_delete( lua_State * );
int vlclua_acl_check( lua_State * );
int vlclua_acl_duplicate( lua_State * );
int vlclua_acl_add_host( lua_State * );
int vlclua_acl_add_net( lua_State * );
int vlclua_acl_load_file( lua_State * );
/*****************************************************************************
* Lua function bridge
*****************************************************************************/
......@@ -145,8 +173,15 @@ int vlclua_push_ret( lua_State *, int i_error );
int vlclua_version( lua_State * );
int vlclua_license( lua_State * );
int vlclua_copyright( lua_State * );
int vlclua_quit( lua_State * );
int vlclua_datadir( lua_State * );
int vlclua_homedir( lua_State * );
int vlclua_configdir( lua_State * );
int vlclua_cachedir( lua_State * );
int vlclua_datadir_list( lua_State * );
int vlclua_pushvalue( lua_State *L, int i_type, vlc_value_t val ); /* internal use only */
int vlclua_var_get( lua_State * );
int vlclua_var_get_list( lua_State * );
......@@ -169,6 +204,7 @@ int vlclua_stream_delete( lua_State * );
int vlclua_decode_uri( lua_State * );
int vlclua_resolve_xml_special_chars( lua_State * );
int vlclua_convert_xml_special_chars( lua_State * );
int vlclua_msg_dbg( lua_State * );
int vlclua_msg_warn( lua_State * );
......
......@@ -263,3 +263,83 @@ DIST_lua= \
luaintf/modules/host.lua \
luaintf/telnet.lua \
luaintf/dummy.lua
DIST_http_lua = \
http-lua/.hosts \
http-lua/dialogs/.hosts \
http-lua/dialogs/browse \
http-lua/dialogs/footer \
http-lua/dialogs/input \
http-lua/dialogs/main \
http-lua/dialogs/mosaic \
http-lua/dialogs/playlist \
http-lua/dialogs/sout \
http-lua/dialogs/vlm \
http-lua/favicon.ico \
http-lua/images/delete.png \
http-lua/images/delete_small.png \
http-lua/images/eject.png \
http-lua/images/empty.png \
http-lua/images/fullscreen.png \
http-lua/images/help.png \
http-lua/images/info.png \
http-lua/images/loop.png \
http-lua/images/minus.png \
http-lua/images/next.png \
http-lua/images/pause.png \
http-lua/images/play.png \
http-lua/images/playlist.png \
http-lua/images/playlist_small.png \
http-lua/images/plus.png \
http-lua/images/prev.png \
http-lua/images/refresh.png \
http-lua/images/repeat.png \
http-lua/images/sd.png \
http-lua/images/shuffle.png \
http-lua/images/slider_bar.png \
http-lua/images/slider_left.png \
http-lua/images/slider_point.png \
http-lua/images/slider_right.png \
http-lua/images/snapshot.png \
http-lua/images/slow.png \
http-lua/images/sort.png \
http-lua/images/sout.png \
http-lua/images/speaker.png \
http-lua/images/speaker_mute.png \
http-lua/images/stop.png \
http-lua/images/vlc16x16.png \
http-lua/images/volume_down.png \
http-lua/images/volume_up.png \
http-lua/images/white.png \
http-lua/images/white_cross_small.png \
http-lua/index.html \
http-lua/js/functions.js \
http-lua/js/mosaic.js \
http-lua/js/vlm.js \
http-lua/mosaic.html \
http-lua/old/.hosts \
http-lua/old/admin/.access \
http-lua/old/admin/browse.html \
http-lua/old/admin/dboxfiles.html \
http-lua/old/admin/index.html \
http-lua/old/cone_minus.png \
http-lua/old/cone_plus.png \
http-lua/old/index.html \
http-lua/old/info.html \
http-lua/old/style.css \
http-lua/old/vlm/edit.html \
http-lua/old/vlm/index.html \
http-lua/old/vlm/new.html \
http-lua/old/vlm/show.html \
http-lua/old/webcam.html \
http-lua/requests/browse.xml \
http-lua/requests/playlist.xml \
http-lua/requests/status.xml \
http-lua/requests/vlm.xml \
http-lua/requests/vlm_cmd.xml \
http-lua/requests/readme \
http-lua/style.css \
http-lua/iehacks.css \
http-lua/vlm.html \
http-lua/vlm_export.html \
http-lua/flash.html
#
# Access-list for VLC HTTP interface
# $Id$
#
# localhost
::1
127.0.0.1
# link-local addresses
#fe80::/64
# private addresses
#fc00::/7
#fec0::/10
#10.0.0.0/8
#172.16.0.0/12
#192.168.0.0/16
#169.254.0.0/16
# The world (uncommenting these 2 lines is not quite safe)
#::/0
#0.0.0.0/0
local _G = _G
module("custom",package.seeall)
local dialogs_cache = {}
function dialog_preload(name)
if not dialogs_cache[name] then
-- Cache the dialogs
dialogs_cache[name] = process(http_dir.."/dialogs/"..name)
end
end
function dialog(name)
dialog_preload(name)
dialogs_cache[name]()
end
function dialogs(...)
for i=1,select("#",...) do
dialog(select(i,...))
end
end
_G.dialogs = dialogs
_G.vlm = vlc.vlm.new()
# This file is an empty access list. Leave it as is.
# You are not supposed to access files from this directory directly.
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< browse: VLC media player web interface - remote file browse dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="browse" class="popup" style="display: none;">
<div class="title">
Browse
<img class="close" src="images/white_cross_small.png" alt="Close" onclick="hide('browse');"/>
</div>
<div id="browser">
<a href="javascript:browse_dir(document.getElementById( 'browse_lastdir' ).value);">Click here to browse</a>
( or <a href="javascript:browse_dir('');">here</a> if it doesn't work )
</div>
<div class="controls">
<button id="btn_browse_close" onclick="hide('browse');">
Close
</button>
<input type="hidden" id="browse_lastdir" value="~" />
<input type="hidden" id="browse_dest" value="" />
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< footer: VLC media player web interface - VLC copyright footer
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="footer" class="dialog" >
<a href="/">main VLC interface</a> -
<a href="/vlm.html">VLM interface</a> -
<a href="/mosaic.html">Mosaic wizard</a> -
<a href="/flash.html">Flash based remote playback</a> -
<a href="http://www.videolan.org">VideoLAN website</a>
<br />
<?vlc print(vlc.copyright()) ?>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< input: VLC media player web interface - input selection dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: browse
]]?>
<div id="input" class="dialog" style="display: none">
<div class="title">
Input
<img class="close" src="images/white_cross_small.png" alt="Close" onclick="hide('input');"/>
</div>
<div class="controls">
<label for="input_mrl">Input (MRL)</label>
<?vlc if current_page == "vlm" then ?>
<input type="text" name="input_mrl" id="input_mrl" size="60" onkeypress="if( event.keyCode == 13 ) vlm_input_change();"/>
<input type="button" value="Ok" onclick="vlm_input_change();" />
<input type="button" value="Cancel" onclick="hide('input');" />
<input type="hidden" id="input_dest" value="" />
<?vlc else ?>
<input type="text" name="input_mrl" id="input_mrl" size="60" onkeypress="if( event.keyCode == 13 ) in_play();"/>
<input type="button" value="Play" onclick="in_play();" />
<input type="button" value="Enqueue" onclick="in_enqueue();" />
<?vlc end ?>
<br/>
<!--<button id="btn_inhide" onclick="hide_input();">
Hide
</button>-->
<button id="btn_file" onclick="hide_input();show('input_file');update_input_file();">
File
</button>
<button id="btn_disc" onclick="hide_input();show('input_disc');update_input_disc();">
Disc
</button>
<button id="btn_network" onclick="hide_input();show('input_network');update_input_net();">
Network
</button>
<button id="btn_fake" onclick="hide_input();show('input_fake');update_input_fake();">
Fixed image
</button>
</div>
<div id="input_helper" class="helper" >
<div id="input_file" style="display: block">
Open File
<hr/>
<label for="input_file_filename">File name</label>
<input type="text" id="input_file_filename" size="60" onchange="update_input_file();" onfocus="update_input_file();"/>
<input type="button" id="input_file_browse" value="Browse" onclick="browse( 'input_file_filename' );" />
<!-- <hr/>
<input type="checkbox" id="input_sub_options" />
<label for="input_sub_options">Subtitle options *TODO/FIXME/FIXHTTPD*</label>
<br/>
<label for="input_sub_file">Subtitles file</label>
<input type="text" id="input_sub_file" size="60" />
<br/>
<label for="input_sub_enc">Subtitles encoding</label>
<select id="input_sub_enc">
<option></option>
</select>
<br/>
<label for="input_sub_size">Font size</label>
<select id="input_sub_size">
<option></option>
</select>
<label for="input_sub_justification">Justification</label>
<select id="input_sub_justification">
<option></option>
</select>
<br/>
<label for="input_sub_fps">Frames per second</label>
<input type="text" id="input_sub_fps" />
<label for="input_sub_delay">Delay</label>
<input type="text" id="input_sub_delay" />-->
</div>
<div id="input_disc" style="display: none">
Open Disc
<hr/>
Disc type :
<input type="radio" name="input_disc_type" id="input_disc_dvdmenu" value="dvd" onchange="update_input_disc();" />
<label for="input_disc_dvdmenu">DVD (menus)</label>
<input type="radio" name="input_disc_type" id="input_disc_dvd" value="dvdsimple" onchange="update_input_disc();" />
<label for="input_disc_dvd">DVD</label>
<input type="radio" name="input_disc_type" id="input_disc_vcd" value="vcd" onchange="update_input_disc();" />
<label for="input_disc_vcd">VCD</label>
<input type="radio" name="input_disc_type" id="input_disc_cdda" value="cdda" onchange="update_input_disc();" />
<label for="input_disc_cdda">Audio CD</label>
<hr/>
<table>
<tr>
<td>
<label for="input_disc_dev">Device name</label>
</td>
<td>
<input type="text" id="input_disc_dev" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_title">Title</label>
</td>
<td>
<input type="text" id="input_disc_title" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_chapter">Chapter</label>
</td>
<td>
<input type="text" id="input_disc_chapter" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_subtrack">Subtitles track</label>
</td>
<td>
<input type="text" id="input_disc_subtrack" onchange="update_input_disc();" />
</td>
</tr>
<tr>
<td>
<label for="input_disc_audiotrack">Audio track</label>
</td>
<td>
<input type="text" id="input_disc_audiotrack" onchange="update_input_disc();" />
</td>
</tr>
</table>
</div>
<div id="input_network" style="display: none">
Open Network
<hr/>
<table>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_udp" value="udp" onchange="update_input_net();" />
<label for="input_net_udp">UDP/RTP</label>
</td>
<td>
<label for="input_net_udp_port">Port</label>
<input type="text" id="input_net_udp_port" size="6" onchange="update_input_net();" />
<input type="checkbox" id="input_net_udp_forceipv6" onchange="update_input_net();" />
<label for="input_net_udp_forceipv6">Force IPv6</label>
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_udpmcast" value="udpmcast" onchange="update_input_net();" />
<label for="input_net_udpmcast">UDP/RTP Multicast</label>
</td>
<td>
<label for="input_net_udpmcast_address">Address</label>
<input type="text" id="input_net_udpmcast_address" onchange="update_input_net();" />
<label for="input_net_udpmcast_port">Port</label>
<input type="text" id="input_net_udpmcast_port" size="6" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_http" value="http" onchange="update_input_net();" />
<label for="input_net_http">HTTP/HTTPS/FTP/MMS</label>
</td>
<td>
<label for="input_net_http_url">URL</label>
<input type="text" id="input_net_http_url" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="radio" name="input_net_type" id="input_net_rtsp" value="rtsp" onchange="update_input_net();" />
<label for="input_net_rtsp">RTSP</label>
</td>
<td>
<label for="input_net_rtsp_url">URL</label>
<input type="text" id="input_net_rtsp_url" value="rtsp://" onchange="update_input_net();" />
</td>
</tr>
<tr>
<td>
<input type="checkbox" id="input_net_timeshift" onchange="update_input_net();" />
<label for="input_net_timeshift">Allow timeshifting</label>
</td>
<td></td>
</tr>
</table>
</div>
<div id="input_fake" style="display: none">
Fixed image stream (fake)
<hr/>
<label for="input_fake_filename">Image file name</label>
<input type="text" id="input_fake_filename" size="60" onchange="update_input_fake();" onfocus="update_input_fake();"/>
<input type="button" id="input_fake_browse" value="Browse" onclick="browse( 'input_fake_filename' );" />
<hr/>
<label for="input_fake_width">Width</label>
<input type="text" id="input_fake_width" size="8" onchange="update_input_fake();" />
<label for="input_fake_height">Height</label>
<input type="text" id="input_fake_height" size="8" onchange="update_input_fake();" />
<label for="input_fake_ar">Aspect ratio</label>
<input type="text" id="input_fake_ar" size="8" onchange="update_input_fake();" />
</div>
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< main: VLC media player web interface - main VLC controler
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: input,
sout and playlist .
]]?>
<div id="main" class="dialog" >
<div class="title">
VLC media player
<button id="btn_toggle_text" onclick="toggle_btn_text();" title="Help" >
<img src="images/help.png" alt="Help" />
Help
</button>
</div>
<div class="controls">
<button id="btn_open" onclick="toggle_show('input');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Open" >
<img src="images/eject.png" alt="Open" />
<span class="btn_text">Open</span>
</button>
&nbsp;
<button id="btn_stop" onclick="pl_stop();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Stop" >
<img src="images/stop.png" alt="Stop" />
<span class="btn_text">Stop</span>
</button>
<!--<button id="btn_play" onclick="alert('FIXME');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Play" >
<img src="images/play.png" alt="Play" />
<span class="btn_text">Play</span>
</button>-->
<button id="btn_pause" onclick="pl_pause();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Pause" >
<img src="images/pause.png" alt="Pause" id="btn_pause_img" />
<span class="btn_text">Pause</span>
</button>
&nbsp;
<button id="btn_previous" onclick="pl_previous();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Previous" >
<img src="images/prev.png" alt="Previous" />
<span class="btn_text">Previous</span>
</button>
<button id="btn_next" onclick="pl_next();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Next" >
<img src="images/next.png" alt="Next" />
<span class="btn_text">Next</span>
</button>
&nbsp;
<button id="btn_sout" onclick="toggle_show('sout');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Stream Output" >
<img src="images/sout.png" alt="Stream Output" />
<span class="btn_text">Stream Output</span>
</button>
<button id="btn_playlist" onclick="toggle_show('playlist');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Playlist" >
<img src="images/playlist.png" alt="Playlist" />
<span class="btn_text">Playlist</span>
</button>
<button id="btn_info" onclick="toggle_show('info');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Info" >
<img src="images/info.png" alt="Info" />
<span class="btn_text">Info</span>
</button>
&nbsp;
<button id="btn_fullscreen" onclick="fullscreen();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Fullscreen" >
<img src="images/fullscreen.png" alt="Fullscreen" />
<span class="btn_text">Fullscreen</span>
</button>
&nbsp;
<button id="btn_snapshot" onclick="snapshot();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Take video snapshot" >
<img src="images/snapshot.png" alt="Take video snapshot" />
<span class="btn_text">Take video snapshot</span>
</button>
&nbsp;
<button id="btn_volume_down" onclick="volume_down();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Decrease Volume" >
<img src="images/volume_down.png" alt="Decrease Volume" />
<span class="btn_text">Decrease Volume</span>
</button>
<button id="btn_volume_up" onclick="volume_up();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Increase Volume" >
<img src="images/volume_up.png" alt="Increase Volume" />
<span class="btn_text">Increase Volume</span>
</button>
</div>
<div id="status">
<span id="state">(?)</span>
-
Time : <span id="time">(?)</span>/<span id="length">(?)</span>
-
Volume : <span id="volume">(?)</span>
<br/>
<!-- progress bar -->
<img src="images/slider_left.png" alt="slider left" /><span id="progressbar" style="background-image: url( 'images/slider_bar.png' ); width: 408px; height:16px; position:absolute;" onclick="slider_seek( event, this );" onmousemove="slider_move( event, this );"><img src="images/slider_point.png" alt="slider point" style="position:relative; left:0px;" id="main_slider_point" onmousedown="slider_down( event, this );" onmouseup="slider_up( event, this.parentNode );" onmouseout="slider_up( event, this.parentNode );"/></span><img src="images/slider_right.png" alt="slider right" style="position:relative;left:408px;" />
<br/>
<span id="nowplaying">(?)</span>
<img id="albumart" alt="" src="/art" style="float: right" onclick="refresh_albumart(true);"/>
</div>
</div>
<div id="info" class="dialog" style="display: none;" >
<div class="title">
Stream and media info
<img class="close" src="images/white_cross_small.png" alt="Close" onclick="hide('info');"/>
</div>
<div id="infotree">
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< mosaic: VLC media player web interface - mosaic wizard
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: input and
sout.
]]?>
<div id="mosaic" class="dialog">
<div class="title">
VLC media player - Mosaic wizard
<button id="btn_toggle_text" onclick="toggle_btn_text();">
<img src="images/help.png" alt="Help" />
Help
</button>
</div>
<div class="controls">
<b>Mosaic dimensions:</b><br/>
<table style="text-align: right;">
<tr>
<td>
<label for="bg_width">Background width*:</label> <input class="mosaic_bg" type="text" id="bg_width" value="400" size="8" onchange="mosaic_size_change();" />
</td>
<td>
<label for="bg_height">Background height*:</label> <input class="mosaic_bg" type="text" id="bg_height" value="300" size="8" onchange="mosaic_size_change();" />
</td>
</tr>
<tr>
<td>
<label for="mosaic_width">Width:</label> <input class="mosaic_tbl" type="text" id="mosaic_width" value="200" size="8" onchange="mosaic_size_change();" />
</td>
<td>
<label for="mosaic_height">Height:</label> <input class="mosaic_tbl" type="text" id="mosaic_height" value="200" size="8" onchange="mosaic_size_change();" />
</td>
</tr>
<tr>
<td>
<label for="mosaic_xoffset">X offset (left):</label> <input class="mosaic_tbl" type="text" id="mosaic_xoffset" value="10" size="8" onchange="mosaic_size_change();" />
</td>
<td>
<label for="mosaic_yoffset">Y offset (top):</label> <input class="mosaic_tbl" type="text" id="mosaic_yoffset" value="10" size="8" onchange="mosaic_size_change();" />
</td>
</tr>
<tr>
<td>
<label for="mosaic_cols">Columns:</label> <input class="mosaic_itm" type="text" id="mosaic_cols" value="2" size="8" onchange="mosaic_size_change();" />
</td>
<td>
<label for="mosaic_rows">Rows:</label> <input class="mosaic_itm" type="text" id="mosaic_rows" value="2" size="8" onchange="mosaic_size_change();" />
</td>
</tr>
<tr>
<td>
<label for="mosaic_hborder">Horizontal border:</label> <input class="mosaic_itm" type="text" id="mosaic_hborder" value="10" size="8" onchange="mosaic_size_change();" />
</td>
<td>
<label for="mosaic_vborder">Vertical border:</label> <input class="mosaic_itm" type="text" id="mosaic_vborder" value="5" size="8" onchange="mosaic_size_change();" />
</td>
</tr>
<tr>
<td colspan="2">
*: these values aren't used by the mosaic code.<br/> They're only here to adapt the preview's size.
</td>
</tr>
</table>
<b>Background:</b><br/>
<label for="mosaic_bg_input">Input:<label> <input type="text" id="mosaic_bg_input" class="mosaic_bg" value="" size="60" onblur="mosaic_code_update();" /> <input type="button" value="Edit" onclick="vlm_input_edit( 'mosaic_bg_input' );" /><br/>
<b>Item:</b><br/>
<label for="mosaic_input_name">Name:</label> <input type="text" id="mosaic_input_name" value="" class="mosaic_itm" />
<label for="mosaic_input">Input:</label> <input type="text" id="mosaic_input" value="" class="mosaic_itm" /> <input type="button" value="Edit" onclick="vlm_input_edit( 'mosaic_input' );" /> <input type="button" value="Add to input list" onclick="mosaic_add_input();" /><br/>
<b>Stream:</b> (leave this empty to display locally)<br/>
<label for="mosaic_output">Output:</label> <input type="text" id="mosaic_output" value="" size="60" onblur="mosaic_code_update();" /> <input type="button" value="Edit" onclick="vlm_output_edit( 'mosaic_output' );" /><br/>
<div id="mosaic_feedback"></div>
</div>
<div id="mosaic_list" class="popup">[<a href="javascript:hide('mosaic_list');">hide</a>] - Select a stream:<br/><div id="mosaic_list_content"></div></div>
<div class="controls">
Click on each of the cells to assign inputs. (<a href="javascript:document.getElementById('mosaic_list').value='';show('mosaic_list');">Show input list</a>)
</div>
</div>
<div id="mosaic_layout" class="mosaic_bg"></div>
<div class="dialog" style="overflow:visible;">
<div class="controls">
<input type="button" value="Let's go!" onclick="mosaic_batch(document.getElementById('mosaic_code').value);" />
<input type="button" value="Stop" onclick="mosaic_stop()" />
<input type="button" id="mosaic_code_show" value="Show VLM code" onclick="show('mosaic_code_div');hide('mosaic_code_show');showinline('mosaic_code_hide');" />
<input type="button" id="mosaic_code_hide" style="display:none" value="Hide VLM code" onclick="hide('mosaic_code_div');hide('mosaic_code_hide');showinline('mosaic_code_show');" />
<br/><br/>
</div>
<div id="mosaic_code_div" style="display:none;" >
Edit the following VLM command batch if you want to fine tune your mosaic settings:
<textarea id="mosaic_code" cols="80" rows="30"></textarea>
</div>
</div>
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< playlist: VLC media player web interface - playlist dialog
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: <none>
]]?>
<div id="playlist" class="dialog" >
<div class="title">
Playlist
<img class="close" src="images/white_cross_small.png" alt="Close" onclick="hide('playlist');"/>
</div>
<div class="controls">
<table>
<tr>
<td>
<!--<button id="btn_delete" onmouseover="button_over(this);" onmouseout="button_out(this);">
<img src="images/delete.png" alt="Delete" />
<span class="btn_text">Delete</span>
</button>-->
<button id="btn_empty" onclick="pl_empty();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Empty" >
<img src="images/empty.png" alt="Empty" />
<span class="btn_text">Empty</span>
</button>
<button id="btn_shuffle" onclick="pl_shuffle();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Shuffle" >
<img src="images/shuffle.png" alt="Shuffle" />
<span class="btn_text">Shuffle</span>
</button>
<button id="btn_loop" onclick="pl_loop();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Loop" >
<img src="images/loop.png" alt="Loop" />
<span class="btn_text">Loop</span>
</button>
<button id="btn_repeat" onclick="pl_repeat();" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Repeat" >
<img src="images/repeat.png" alt="Repeat" />
<span class="btn_text">Repeat</span>
</button>
</td>
<td onmouseout="hide_menu('menu_sort');" onmouseover="show_menu('menu_sort');" >
<button id="btn_sort" title="Sort" >
<img src="images/sort.png" alt="Sort" />
<span class="btn_text">Sort</span>
</button>
<div id="menu_sort" class="menu" >
<button class="menuout" onclick="pl_sort(1,0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Name ascending" >Name</button><br/>
<button class="menuout" onclick="pl_sort(1,1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Name descending" >Name reverse</button><br/>
<button class="menuout" onclick="pl_sort(3,0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Author ascending" >Author</button><br/>
<button class="menuout" onclick="pl_sort(3,1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Author ascending" >Author reverse</button><br/>
<button class="menuout" onclick="pl_sort(5,0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Randomize" >Random</button><br/>
<button class="menuout" onclick="pl_sort(7,0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Track number" >Track number</button><br/>
<button class="menuout" onclick="pl_sort(0,0);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id ascending" >Id</button><br/>
<button class="menuout" onclick="pl_sort(0,1);hide_menu('menu_sort');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" title="Sort by Id descending" >Id reverse</button><br/>
</div>
</td>
<td onmouseover="show_menu('menu_sd');" onmouseout="hide_menu('menu_sd');">
<button id="btn_sd" title="Services Discovery" >
<img src="images/sd.png" alt="Services Discovery" />
<span class="btn_text">Services Discovery</span>
</button>
<div id="menu_sd" class="menu" >
<?vlc --[[ FIXME
<vlc id="rpn" param1="services_discovery" />
<vlc id="foreach" param1="sd" param2="object" />
<button onclick="pl_sd('<vlc id="value" param1="sd" />');hide_menu('menu_sd');" onmouseover="setclass(this,'menuover');" onmouseout="setclass(this,'menuout');" class="menuout" title="Toggle <vlc id="value" param1="sd.name" />" ><vlc id="value" param1="sd.name" /></button><br/>
<vlc id="end" />
]] ?>
</div>
</td>
</tr>
</table>
</div>
<div id="playtree">
(?)
</div>
</div>
This diff is collapsed.
<?vlc --[[
vim:syntax=html
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm: VLC media player web interface - VLM controler
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
This dialog needs the following dialogs to be fully functional: input,
sout and vlmelements .
]]?>
<div id="vlm" class="dialog" >
<div class="title">
VLC media player - VLM interface
<!--
<button id="btn_toggle_text" onclick="toggle_btn_text();">
<img src="images/help.png" alt="Help" />
Help
</button>
-->
</div>
<div class="controls">
<label for="vlm_command">VLM command:</label>
<input type="text" id="vlm_command" size="60" onkeypress="if( event.keyCode == 13 ) vlm_send();" />
<input type="button" value="Send" onclick="vlm_send();" />
<br />
<span id="vlm_error"></span>
<br />
<span id="vlm_helper_controls">
<button id="btn_broadcast" onclick="hide_vlm_add();show('vlm_add_broadcast');update_vlm_add_broadcast();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Broadcast
</button>
<button id="btn_vod" onclick="hide_vlm_add();show('vlm_add_vod');update_vlm_add_vod();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Video on Demand
</button>
<button id="btn_schedule" onclick="hide_vlm_add();show('vlm_add_schedule');update_vlm_add_schedule();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Schedule
</button>
<button id="btn_other" onclick="hide_vlm_add();show('vlm_add_other');update_vlm_add_other();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Other
</button>
</span>
<button id="btn_vlm_helper_toggle" onclick="toggle_show_vlm_helper();" onmouseover="button_over(this);" onmouseout="button_out(this);">
Hide VLM helper
</button>
</div>
<div id="vlm_helper" class="helper" >
<div id="vlm_add_broadcast" style="display: block">
New broadcast element
<hr />
<label for="vlm_broadcast_name">Name</label>
<input type="text" id="vlm_broadcast_name" size="20" onchange="update_vlm_add_broadcast();" />
<input type="checkbox" id="vlm_broadcast_enabled" onchange="update_vlm_add_broadcast();" />
<label for="vlm_broadcast_enabled">Enable</label>
<input type="checkbox" id="vlm_broadcast_loop" onchange="update_vlm_add_broadcast();" />
<label for="vlm_broadcast_loop">Loop</label>
<br/>
<label for="vlm_broadcast_input">Input</label>
<input type="text" id="vlm_broadcast_input" size="60" onblur="update_vlm_add_broadcast();" />
<input type="button" value="Edit" onclick="vlm_input_edit('vlm_broadcast_input');" />
<br/>
<label for="vlm_broadcast_output">Output</label>
<input type="text" id="vlm_broadcast_output" size="60" onblur="update_vlm_add_broadcast();" />
<input type="button" value="Edit" onclick="vlm_output_edit('vlm_broadcast_output');" />
<br/>
</div>
<div id="vlm_add_vod" style="display: none">
New video on demand element
<hr />
<label for="vlm_vod_name">Name</label>
<input type="text" id="vlm_vod_name" size="20" onchange="update_vlm_add_vod();" />
<input type="checkbox" id="vlm_vod_enabled" onchange="update_vlm_add_vod();" />
<label for="vlm_vod_enabled">Enable</label>
<br/>
<label for="vlm_vod_input">Input</label>
<input type="text" id="vlm_vod_input" size="60" onblur="update_vlm_add_vod();" />
<input type="button" value="Edit" onclick="vlm_input_edit('vlm_vod_input');" />
<br/>
<label for="vlm_vod_output">Output (leave empty unless you want to transcode)</label>
<input type="text" id="vlm_vod_output" size="60" onblur="update_vlm_add_vod();" />
<input type="button" value="Edit" onclick="vlm_output_edit('vlm_vod_output');" />
<br/>
</div>
<div id="vlm_add_schedule" style="display: none">
New schedule
<hr />
<label for="vlm_schedule_name">Name</label>
<input type="text" id="vlm_schedule_name" size="20" onchange="update_vlm_add_schedule();" />
<input type="checkbox" id="vlm_schedule_enabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_enabled">Enable</label>
<br />
Schedule date:
<input type="checkbox" id="vlm_schedule_now" onchange="toggle_schedule_date();update_vlm_add_schedule();" />
<label for="vlm_schedule_now">Now</label>
<br/>
<label for="vlm_schedule_year">Year:</label>
<input type="text" id="vlm_schedule_year" value="1970" size="4" maxlength="4" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_month">Month:</label>
<input type="text" id="vlm_schedule_month" value="01" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_day">Day:</label>
<input type="text" id="vlm_schedule_day" value="01" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_hour">Hour:</label>
<input type="text" id="vlm_schedule_hour" value="00" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_minute">Minute:</label>
<input type="text" id="vlm_schedule_minute" value="59" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_second">Second:</label>
<input type="text" id="vlm_schedule_second" value="59" size="2" maxlength="2" onchange="update_vlm_add_schedule();" />
<br/>
Schedule period:<br/>
<input type="checkbox" id="vlm_schedule_repeat" onchange="toggle_schedule_repeat();update_vlm_add_schedule();" />
<label for="vlm_schedule_repeat">Repeat</label>
<br />
<label for="vlm_schedule_period_year">Year:</label>
<input type="text" id="vlm_schedule_period_year" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_month">Month:</label>
<input type="text" id="vlm_schedule_period_month" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_day">Day:</label>
<input type="text" id="vlm_schedule_period_day" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_hour">Hour:</label>
<input type="text" id="vlm_schedule_period_hour" value="0" size="2" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_minute">Minute:</label>
<input type="text" id="vlm_schedule_period_minute" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<label for="vlm_schedule_period_second">Second:</label>
<input type="text" id="vlm_schedule_period_second" value="0" size="4" disabled="disabled" onchange="update_vlm_add_schedule();" />
<br />
<label for="vlm_schedule_repeat_times">Number of repetitions (use 0 to repeat endlessly):</label>
<input type="text" id="vlm_schedule_repeat_times" size="8" disabled="disabled" value="0" onchange="update_vlm_add_schedule();" />
</div>
<div id="vlm_add_other" style="display: none">
<input type="button" id="btn_import" onclick="vlm_batch(document.getElementById('vlm_batch_text').value);" value="Send command batch" />
<input type="button" id="btn_export" onclick="document.location.assign('vlm_export.html');" value="Export VLM commands (new page)" />
<br/>
<textarea cols="70" rows="20" id="vlm_batch_text">#paste your VLM commands here</textarea>
</div>
</div>
</div>
<div id="vlm_broadcast" class="dialog" >
<div class="title">
Broadcast Elements
<button id="btn_refresh_broadcast" onclick="vlm_get_elements();" title="Refresh" >
<img src="images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_broadcast_list" class="list"></div>
</div>
<div id="vlm_vod" class="dialog" >
<div class="title">
Video on Demand Elements
<button id="btn_refresh_vod" onclick="vlm_get_elements();" title="Refresh" >
<img src="images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_vod_list" class="list"></div>
</div>
<div id="vlm_schedule" class="dialog" >
<div class="title">
Schedule Elements
<button id="btn_refresh_schedule" onclick="vlm_get_elements();" title="Refresh" >
<img src="images/refresh.png" alt="Refresh" />
</button>
</div>
<div id="vlm_schedule_list" class="list"></div>
</div>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>VLC media player - Web Interface with Flash Viewer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE ]>
<link href="iehacks.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript">
// <![CDATA[
host = document.location.toString().replace( /http:\/\//, '' ).replace( /[:/].*/, '' );
// ]]>
</script>
</head>
<body onload="hide('playlist');">
<?vlc
current_page = "index"
dialogs("browse","main","input","playlist") ?>
<input id="sout_mrl" type="hidden" value=":sout=#transcode{vcodec=FLV1,acodec=mp3,channels=2,samplerate=44100}:std{access=http,mux=ffmpeg{mux=flv},dst=0.0.0.0:8081/stream.flv} :no-sout-keep" />
<div style='height: 100%; width: 100%; text-align: center;'>
<object type="application/x-shockwave-flash" data="http://flowplayer.sourceforge.net/video/FlowPlayer.swf" width="800px" height="600px" id="FlowPlayer" style="z-index: 0">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="http://flowplayer.sourceforge.net/video/FlowPlayer.swf" />
<param name="quality" value="high" />
<!-- <param name="scale" value="noScale" />-->
<param name="wmode" value="transparent" />
<!-- <param name="flashvars" value="config={ loop: false, initialScale: \'fit\', autoPlay: false, configInject: true}" />-->
<script type="text/javascript">
// <![CDATA[
document.write( '' +
' <param name="flashvars" value="config={ loop: false, initialScale: \'fit\', autoPlay: false, playList: [{ url: \'http://' + host + ':8081/stream.flv\', controlEnabled: true}] }" />' );
// ]]>
</script>
</object>
<p style="font-size: small;">Uses the <a href="http://flowplayer.sourceforge.net/">Flow Player</a> free flash video player for playback (client side).</p>
</div>
<?vlc dialogs("footer") ?>
</body>
</html>
/*****************************************************************************
* iehacks.css: VLC media player web interface
*****************************************************************************
* Copyright (C) 2006 the VideoLAN team
* $Id$
*
* Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
div.menu {
margin-left: -30px;
margin-top: 15px;
background: #fff;
}
div.menu button {
background: #fff;
}
div.menu button.menuout {
border: 1px solid #fff;
}
div#mosaic_list {
background: #fff;
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< index.html: VLC media player web interface
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>VLC media player - Web Interface</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?vlc --[[ <vlc id="value" param1="charset"/> ]] ?>" />
<link href="style.css" rel="stylesheet" type="text/css" />
<!--[if IE ]>
<link href="iehacks.css" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript" src="js/functions.js"></script>
</head>
<body onload="loop_refresh();">
<noscript>
<hr/>
<p>
Warning: Your browser doesn't support javascript.
You should use the <a href="old/">old http interface</a>.
</p>
<hr/>
</noscript>
<?vlc
current_page = "index"
dialogs("browse","main","input","sout","playlist","footer")
?>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< vlm.html: VLC media player web interface - VLM
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >
< Copyright (C) 2005-2006 the VideoLAN team
< $Id$
<
< Authors: Antoine Cellerier <dionoea -at- videolan -dot- org>
<
< This program is free software; you can redistribute it and/or modify
< it under the terms of the GNU General Public License as published by
< the Free Software Foundation; either version 2 of the License, or
< (at your option) any later version.
<
< This program 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 General Public License for more details.
<
< You should have received a copy of the GNU General Public License
< along with this program; if not, write to the Free Software
< Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
< - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>VLC media player - Web Interface - Mosaic Wizard</title>
<meta http-equiv="Content-Type" content="text/html; charset=<?vlc --[[FIXME charset]]?>" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/functions.js"></script>
<script type="text/javascript" src="js/vlm.js"></script>
<script type="text/javascript" src="js/mosaic.js"></script>
</head>
<body onload="mosaic_init();">
<h1>Mosaic wizard</h1>
<?vlc
current_page = "vlm"
dialogs("browse","input","sout","mosaic","footer")
?>
</body>
</html>
#
# Default access-list for VLC HTTP interface
# $Id$
#
# localhost
::1
127.0.0.1
# link-local addresses
#fe80::/64
# private addresses
#fc00::/7
#fec0::/10
#10.0.0.0/8
#172.16.0.0/12
#192.168.0.0/16
# The world
# (comment this out to obtain a safe default)
::/0
0.0.0.0/0
<html>
<head>
<title>VLC media player - Browser</title>
<link href="../style.css" title="Default" rel="stylesheet" type="text/css" />
<vlc id="if" param1="'control' url_extract strlen"/>
<meta http-equiv="refresh" content="0;URL=/old/admin/browse.html?dir=<vlc id="value" param1="'dir' url_extract" />" />
<vlc id="end" />
<vlc id="control" param1="add"/>
</head>
<body>
<h2><center><a href="/old/">VLC media player <vlc id="value" param1="version" /></a></center></h2>
<hr/>
<table width="100%" border=0 cellspacing=1 cellpadding=2>
<tr>
<th align="left" bgcolor="#88ff88" colspan="2">File (<vlc id="value" param1="'dir' url_extract" />)</th>
<th align="left" bgcolor="#cccccc">Size</th>
<th align="left" bgcolor="#cccccc">Date</th>
</tr>
<p>This page is default disabled for security reasons (change _directory_ into directory to enable it).</p>
<vlc id="rpn" param1="counter 0 store" />
<vlc id="rpn" param1="'dir' url_extract" />
<vlc id="foreach" param1="file" param2="_directory_" />
<vlc id="rpn" param1="counter counter value 1 + store" />
<tr class="<vlc id="if" param1="counter value 2 % 0 =" />line1<vlc id="else" />line2<vlc id="end" />">
<td>
<vlc id="if" param1="file.type value 'directory' strcmp 0 =" />
<img src="/icons/dir.gif" alt=[DIR]" border="0" width="20" height="22">
<a href="?dir=<vlc id="value" param1="file.name" />"><vlc id="value" param1="file.name" /></a>
<vlc id="else" />
<img src="/icons/text.gif" alt=[FILE]" border="0" width="20" height="22">
<vlc id="value" param1="file.name" />
<vlc id="end" />
</td>
<td align="right">
<form method="get" action="">
<input type="hidden" name="dir" value="<vlc id="value" param1="'dir' url_extract" />"/>
<input type="hidden" name="mrl" value="<vlc id="value" param1="file.name" />"/>
<input type="submit" name="control" value="add" />
</form>
</td>
<td align="right"><vlc id="value" param1="file.size" /></td>
<td align="center"><vlc id="value" param1="file.date" /></td>
</tr>
<vlc id="end" />
</table>
<hr/>
<p><vlc id="value" param1="copyright" /> </p>
</body>
</html>
<vlc id="rpn" param1="'stream_position' url_extract" /><vlc id="if" param1="value 'true' strcmp 0 =" /><vlc id="value" param1="stream_position" /><vlc id="end" /><vlc id="rpn" param1="'stream_time' url_extract" /><vlc id="if" param1="value 'true' strcmp 0 =" /><vlc id="value" param1="stream_time" /><vlc id="end" /><vlc id="rpn" param1="'stream_length' url_extract" /><vlc id="if" param1="value 'true' strcmp 0 =" /><vlc id="value" param1="stream_length" /><vlc id="end" /><vlc id="rpn" param1="'dir' url_extract" /><vlc id="foreach" param1="file" param2="directory" /><vlc id="if" param1="file.type value 'directory' strcmp 0 =" />DIR:<vlc id="value" param1="file.name" /><vlc id="else" /><vlc id="value" param1="file.name" /><vlc id="end" />
<vlc id="end" />
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml10/DTD/xhtml10transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>VLC media player</title>
<style>
body {font-family:Verdana, Arial, Sans Serif; }
h2 { text-align:center; }
td {border:1pt black solid;margin:0em; }
table.border {border:1pt black solid;}
div.section {background-color:#DDDDFF;
border:1pt black solid;
margin-bottom:2em;
padding:0.5em; }
div.section-ctr {background-color:#CCCCFF;
border:1pt black solid;
margin-bottom:2em;
padding:0.5em;
font-size:1.2em;
text-align:center; }
div.sectitle { background-color:#5A5ABB;
color:#FFFFFF;
border:1pt black solid;
width:20%;
font-weight:bold;}
tr.ligne1 { background-color:#EEFFFF; }
tr.ligne2 { background-color:#CCCCFF; }
</style>
<vlc id="if" param1="url_param"/>
<meta http-equiv="refresh" content="0;URL=/old/admin/" />
<vlc id="end" />
<vlc id="control" />
<vlc id="set" param1="sout" param2="string" />
</head>
<body>
<h2><a href="/old/">VLC media player - Admin <vlc id="value" param1="version" /></a></h2>
<div class="section-ctr">Shutdown VLC<br /> <form method="get" action=""> <input type="submit" name="control" value="shutdown" /> </form></div>
<div class="sectitle">Host list</div>
<div class="section">
<table class="border" >
<tr>
<th>Id</th><th>Host</th><th>IP</th><th>Port</th>
</tr>
<vlc id="foreach" param1="host" param2="hosts" />
<tr>
<td><vlc id="value" param1="host.id" /></td>
<td><vlc id="value" param1="host.host" /> </td>
<td><vlc id="value" param1="host.ip" /> </td>
<td><vlc id="value" param1="host.port" /> </td>
</tr>
<vlc id="end" />
</table>
</div>
<div class="sectitle">File list</div>
<div class="section">
<table border="1" cellspacing="0" >
<tr>
<th>Id</th><th>URL</th><th>Mime</th><th>Protected</th><th>Usage</th>
</tr>
<vlc id="foreach" param1="url" param2="urls" />
<vlc id="if" param1="url.stream 0 =" />
<tr>
<td><vlc id="value" param1="url.id" /></td>
<td><vlc id="value" param1="url.url" /></td>
<td><vlc id="value" param1="url.mime" /></td>
<td><vlc id="value" param1="url.protected" /></td>
<td><vlc id="value" param1="url.used" /></td>
</tr>
<vlc id="end" />
<vlc id="end" />
</table>
</div>
<div class="sectitle">Stream list</div>
<div class="section">
<table border="1" cellspacing="0" >
<tr>
<th>Id</th><th>URL</th><th>Mime</th><th>Protected</th><th>Usage</th>
</tr>
<vlc id="foreach" param1="url" param2="urls" />
<vlc id="if" param1="url.stream" />
<tr>
<td><vlc id="value" param1="url.id" /></td>
<td><vlc id="value" param1="url.url" /></td>
<td><vlc id="value" param1="url.mime" /></td>
<td><vlc id="value" param1="url.protected" /></td>
<td><vlc id="value" param1="url.used" /></td>
</tr>
<vlc id="end" />
<vlc id="end" />
</table>
</div>
<div class="sectitle">Connections list</div>
<div class="section">
<table border="1" cellspacing="0" >
<tr>
<th>Id</th><th>ip</th><th>URL</th><th>Status</th><th>Actions</th>
</tr>
<vlc id="foreach" param1="con" param2="connections" />
<tr>
<td><vlc id="value" param1="con.id" /></td>
<td><vlc id="value" param1="con.ip" /></td>
<td><vlc id="value" param1="con.url" /></td>
<td><vlc id="value" param1="con.status" /></td>
<td>
<form method="get" action="">
<input type="hidden" name="id" value="<vlc id="value" param1="con.id" />"/>
<input type="submit" name="control" value="close" />
</form>
</td>
</tr>
<vlc id="end" />
</table>
</div>
<hr />
<p> <vlc id="value" param1="copyright" /> </p>
</body>
</html>
This diff is collapsed.
<html>
<head>
<title>VLC media player - Information</title>
</head>
<body>
<h2><center><a href="/old/">VLC media player <vlc id="value" param1="version" /></a></center></h2>
<hr/>
<vlc id="foreach" param1="cat" param2="information" />
<p> <vlc id="value" param1="cat.name" />
<ul>
<vlc id="foreach" param1="info" param2="cat.info" />
<li> <vlc id="value" param1="info.name" />: <vlc id="value" param1="info.value" /> </li>
<vlc id="end" />
</ul>
<vlc id="end" />
<hr/>
<p><vlc id="value" param1="copyright" /> </p>
</body>
</html>
div {
padding: 0px;
margin: 0px;
border-width: 0px;
border-style: none;
}
/* page body */
body {
font-family: Verdana, Arial, sans-serif;
font-size: 10pt;
padding: 5pt;
margin: 5pt;
}
/* left column */
div.left {
float: left;
width: 19%;
}
/* main content */
div.right {
float: right;
width: 80%;
}
/* section bloc title */
div.sectitle {
background-color: #5A5ABB;
color: #FFFFFF;
border: 1px black solid;
border-bottom: 0pt black none;
font-weight: bold;
padding: 0pt 5pt;
}
/* section bloc content */
div.section {
background-color: #DDDDFF;
border: 1px black solid;
margin-bottom: 2em;
padding: 5pt;
}
/* section bloc controls */
div.section-controls {
text-align: center;
background-color: #DDDDFF;
border: 1px black solid;
margin-bottom: 2em;
padding: 5pt;
}
/* page title */
h2.title {
text-align: center;
}
h3 {
text-align: left;
}
table {
width: 100%;
}
table.add {
width: 100%;
}
/* playlist line */
tr.line1 {
background-color: #EEEEFF;
}
/* playlist line */
tr.line2 {
background-color: #CCCCFF;
}
/* help text */
span.small {
font-size: 0.9em;
}
form {
margin: 0pt;
padding: 0pt;
}
input {
border: 1px solid black;
}
ul#playlist, ul#playlist ul{
list-style-type: none;
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml10/DTD/xhtml10transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>VLC media player</title>
<link href="../style.css" title="Default" rel="stylesheet" type="text/css" />
<vlc id="control" param1="vlm_setup,vlm_new,vlm_del,vlm_play,vlm_pause,vlm_stop,vlm_seek,vlm_save,vlm_load" />
</head>
<body>
<h2>
<a href="http://www.videolan.org/">VLC media player<vlc id="value" param1="version" /></a> (http interface)</h2>
<div class="sectitle">VLM - Edit <vlc id="value" param1="'name' url_extract"/></div>
<div class="section">
<vlc id="foreach" param1="el" param2="vlm" />
<vlc id="if" param1="'name' url_extract el.name value strcmp 0 =" />
<vlc id="if" param1="'type' url_extract 'broadcast' strcmp 0 =" />
<form method="get" action="/old/vlm/" />
<table>
<tr><td>Name : </td><td><vlc id="value" param1="'name' url_extract"/> </td> </tr>
<tr><td>Type: </td><td>Broadcast </td></tr>
<tr><td valign="top">Inputs: </td>
<td>
<vlc id="foreach" param1="in" param2="el.inputs" /><vlc id="value" param1="in" /><br/><vlc id="end" />
<input type="text" name="input" size="40" value=""/><br />
</td></tr>
<tr><td>Output: </td><td><input type="text" name="output" size="40" value="<vlc id="value" param1="el.output" />"/></td></tr>
<tr><td>Option: </td>
<td>
<vlc id="foreach" param1="op" param2="el.options" /><vlc id="value" param1="op" /><br /><vlc id="end" />
<input type="text" name="option" size="40" value=""/><br />
</td></tr>
</table>
<input type="hidden" name="name" value="<vlc id="value" param1="'name' url_extract"/>" />
<button name="control" value="vlm_setup">OK</button>
</form>
<vlc id="else" />
<vlc id="if" param1="'type' url_extract 'schedule' strcmp 0 =" />
<form method="get" action="/old/vlm/" />
<table>
<tr><td>Name : </td><td><vlc id="value" param1="'name' url_extract"/> </td> </tr>
<tr><td>Type: </td><td>Schedule </td></tr>
<tr><td valign="top">Commands: </td>
<td><vlc id="foreach" param1="in" param2="el.commands" /><vlc id="value" param1="in" /><br/><vlc id="end" />
<input type="text" name="append" size="40" value=""/><br/></td></tr>
<tr><td>Date: </td>
<td><input type="text" name="date" size="40" value="<vlc id="value" param1="el.date" />"/></td>
</tr>
<tr><td>Period: </td>
<td><input type="text" name="period" size="40" value="<vlc id="value" param1="el.period" />"/></td>
</tr>
<tr><td>Repeat: </td>
<td><input type="text" name="repeat" size="40" value="<vlc id="value" param1="el.repeat" />"/></td>
</table>
<input type="hidden" name="name" value="<vlc id="value" param1="'name' url_extract"/>" />
<button name="control" value="vlm_setup">OK</button>
</form>
<vlc id="end" />
<vlc id="end" />
<vlc id="end" />
<vlc id="end" />
</div>
<hr/>
<p> <vlc id="value" param1="copyright" /> </p>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml10/DTD/xhtml10transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>VideoLAN browser output</title>
<link href="style.css" title="Default" rel="stylesheet" type="text/css" />
</head>
<body>
<p>
This is an example webpage for viewing a Multipart MJPEG stream from any browser. You should edit it to point to the URL of your MPJEG stream that you are streaming with VLC or with a AXIS webcam for instance. For setting up such a stream, refer to the <a href="http://www.videolan.org/doc">VideoLAN HOWTO</a>.</p>
<p>The page has two modes. A Netscape browser compatible mode which will directly show the videostream, and a mode in which it uses a Java Applet. This is because many browsers cannot handle live MJPEG streams. The Applet in use is the <a href="http://www.charliemouse.com/code/cambozola">Cambozola</a> plugin. You will need to download it from the Cambozola website and put it in the same directory as this webpage.</p>
<h1>Netscape style</h1>
<a href="http://vlc.server.org:8080/thestream">Click Here</a><br />
<h1>Java applet style</h1>
<applet code="com.charliemouse.cambozola.Viewer" archive="cambozola.jar" width="320" height="240">
<param name="url" value="http://vlc.server.org:8080/thestream">
<param name="properties" value="none">
</applet>
</body>
</html>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
## <pre>
##
## <a href="vlm.html">VLM HTTP interface</a>
## This file can be loaded as is in VLM.
## Comments starting with "##" were added by the HTTP interface.
## You can remove them if you want to.
##
<?vlc print(vlc.vlm.execute_command(vlm,"export").value) ?>
##
## end of export
## </pre>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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