Hotkeys via HTTP interface

For questions and discussion that is NOT (I repeat NOT) specific to a certain Operating System.
Sorc17
Blank Cone
Blank Cone
Posts: 14
Joined: 03 May 2011 10:15

Hotkeys via HTTP interface

Postby Sorc17 » 03 May 2011 10:31

I try to find way to zoom video via http interface. But I got some problem with it.

As I see in functions.js:

Code: Select all

function hotkey( str ) { /* Use hotkey name (without the "key-" part) as the argument to simulate a hotkey press */ loadXMLDoc( 'requests/status.xml?command=key&val='+str, parse_status ); }
there is function to emulate hotkey press. I add two new buttons to main part of web interface:

Code: Select all

<button id="btn_zoom_double" onclick="hotkey('zoom-double');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Zoom Double" > <img src="images/zoom_double.png" alt="Zoom Double" /> <span class="btn_text">Zoom Double</span> </button> <button id="btn_zoom_half" onclick="hotkey('zoom-half');" onmouseover="button_over(this);" onmouseout="button_out(this);" title="Zoom Half" > <img src="images/zoom_half.png" alt="Zoom Half" /> <span class="btn_text">Zoom Half</span> </button>
but its do nothing: when I press this buttons in web interface, in logs appears messages:
[0x927b9b8] http interface warning: vlc_var_get called without an object
[0x927b9b8] http interface warning: vlc_var_set called without an object
and zoom of video not changes.

Is it possible to zoom video via http interface? I'll do it wrong? :)

Sorc17
Blank Cone
Blank Cone
Posts: 14
Joined: 03 May 2011 10:15

Re: Hotkeys via HTTP interface

Postby Sorc17 » 05 May 2011 15:29

...
Last edited by Sorc17 on 25 May 2011 16:15, edited 1 time in total.

Sorc17
Blank Cone
Blank Cone
Posts: 14
Joined: 03 May 2011 10:15

Re: Hotkeys via HTTP interface

Postby Sorc17 » 25 May 2011 16:14

I try same on VLC 1.1.9 and got another errors:
[0x84bfd8c] oldhttp interface warning: invalid VLC_OBJECT_LIBVLC variable type 0 (key-zoom-double)
[0x84bfd8c] oldhttp interface warning: invalid VLC_OBJECT_LIBVLC variable type 0 (key-zoom-half)
If you developer guys can tell me where problem can be I can fix it by myself :) Sure I found place where error appears, its from rpn.c

Code: Select all

vlc_object_t *p_object = GetVLCObject( p_intf, psz_object, &b_need_release ); if( p_object != NULL ) { vlc_value_t val; int i_type; i_type = var_Type( p_object, psz_variable ); var_Get( p_object, psz_variable, &val ); switch( i_type & VLC_VAR_TYPE ) { case VLC_VAR_BOOL: SSPushN( st, val.b_bool ); break; case VLC_VAR_INTEGER: case VLC_VAR_HOTKEY: SSPushN( st, val.i_int ); break; case VLC_VAR_STRING: case VLC_VAR_MODULE: case VLC_VAR_FILE: case VLC_VAR_DIRECTORY: case VLC_VAR_VARIABLE: SSPush( st, val.psz_string ); free( val.psz_string ); break; case VLC_VAR_FLOAT: { char psz_value[20]; lldiv_t value = lldiv( val.f_float * 1000000, 1000000 ); snprintf( psz_value, sizeof(psz_value), "%lld.%06u", value.quot, (unsigned int)value.rem ); SSPush( st, psz_value ); break; } default: msg_Warn( p_intf, "invalid %s variable type %d (%s)", psz_object, i_type & VLC_VAR_TYPE, psz_variable ); SSPush( st, "" ); } }
I expect type VLC_VAR_HOTKEY but its not. May be I shall use another javascript function or fix something in xml-s? Cant understand your architecture :)


Return to “General VLC media player Troubleshooting”

Who is online

Users browsing this forum: MSN [Bot] and 35 guests