1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-29 01:45:34 +00:00

Rudimentary support for HTML5 media elements

Make use of the HTML5 media elements, <video> and <audio> by adding
links to the media.
This commit is contained in:
Nils Dagsson Moskopp 2010-08-07 21:56:05 +03:00 committed by Miciah Dashiel Butler Masters
parent 6cb3d30d09
commit 2f0d954add
5 changed files with 50 additions and 0 deletions

View File

@ -437,6 +437,10 @@ Muhamad Faizal <faizal@mfaizal.net>
Nalin Dahyabhai <nalin@redhat.com> Nalin Dahyabhai <nalin@redhat.com>
Fixed occasional destroying of read buffer on Alpha Fixed occasional destroying of read buffer on Alpha
Nils Dagsson Moskopp <nils@dieweltistgarnichtso.net>
Rudimentary support for the HTML5 media elements, <video> and
<audio>.
Nuno Miguel Rodrigues <nmr@europa.net.dhis.org> Nuno Miguel Rodrigues <nmr@europa.net.dhis.org>
UnixWare console fix UnixWare console fix

2
NEWS
View File

@ -69,6 +69,8 @@ Miscellaneous:
* enhancement: Add ``Search contents'' button to the cache manager with * enhancement: Add ``Search contents'' button to the cache manager with
which one can search through the cache items' data rather than their which one can search through the cache items' data rather than their
metadata. metadata.
* enhancement: Add rudimentary support for the HTML5 media elements,
<video> and <audio>.
* link against lua51 not lua50 * link against lua51 not lua50
* configure options to link against libmozjs of xulrunner * configure options to link against libmozjs of xulrunner
* using iconv for some multibyte charsets. It works if the terminal codepage * using iconv for some multibyte charsets. It works if the terminal codepage

View File

@ -407,6 +407,27 @@ html_applet(struct html_context *html_context, unsigned char *a,
mem_free(code); mem_free(code);
} }
void
html_audio(struct html_context *html_context, unsigned char *a,
unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
{
unsigned char *url;
/* This just places a link where a audio element would be. */
url = get_url_val(a, "src", html_context->doc_cp);
if (!url) return;
html_focusable(html_context, a);
put_link_line("Audio: ", basename(url), url,
html_context->options->framename, html_context);
html_skip(html_context, a);
mem_free(url);
}
static void static void
html_iframe_do(unsigned char *a, unsigned char *object_src, html_iframe_do(unsigned char *a, unsigned char *object_src,
struct html_context *html_context) struct html_context *html_context)
@ -530,7 +551,26 @@ html_embed(struct html_context *html_context, unsigned char *a,
mem_free_set(&object_src, NULL); mem_free_set(&object_src, NULL);
} }
void
html_video(struct html_context *html_context, unsigned char *a,
unsigned char *xxx3, unsigned char *xxx4, unsigned char **xxx5)
{
unsigned char *url;
/* This just places a link where a video element would be. */
url = get_url_val(a, "src", html_context->doc_cp);
if (!url) return;
html_focusable(html_context, a);
put_link_line("Video: ", basename(url), url,
html_context->options->framename, html_context);
html_skip(html_context, a);
mem_free(url);
}
/* Link types: /* Link types:

View File

@ -14,6 +14,8 @@ element_handler_T html_iframe;
element_handler_T html_img; element_handler_T html_img;
element_handler_T html_link; element_handler_T html_link;
element_handler_T html_object; element_handler_T html_object;
element_handler_T html_audio;
element_handler_T html_video;
element_handler_T html_embed; element_handler_T html_embed;
#endif #endif

View File

@ -429,6 +429,7 @@ static struct element_info elements[] = {
{"ABBR", html_italic, NULL, 0, ET_NESTABLE }, {"ABBR", html_italic, NULL, 0, ET_NESTABLE },
{"ADDRESS", html_address, NULL, 2, ET_NESTABLE }, {"ADDRESS", html_address, NULL, 2, ET_NESTABLE },
{"APPLET", html_applet, NULL, 1, ET_NON_PAIRABLE}, {"APPLET", html_applet, NULL, 1, ET_NON_PAIRABLE},
{"AUDIO", html_audio, NULL, 1, ET_NON_PAIRABLE},
{"B", html_bold, NULL, 0, ET_NESTABLE }, {"B", html_bold, NULL, 0, ET_NESTABLE },
{"BASE", html_base, NULL, 0, ET_NON_PAIRABLE}, {"BASE", html_base, NULL, 0, ET_NON_PAIRABLE},
{"BASEFONT", html_font, NULL, 0, ET_NON_PAIRABLE}, {"BASEFONT", html_font, NULL, 0, ET_NON_PAIRABLE},
@ -496,6 +497,7 @@ static struct element_info elements[] = {
{"TT", html_tt, NULL, 0, ET_NON_NESTABLE}, {"TT", html_tt, NULL, 0, ET_NON_NESTABLE},
{"U", html_underline, NULL, 0, ET_NESTABLE }, {"U", html_underline, NULL, 0, ET_NESTABLE },
{"UL", html_ul, NULL, 2, ET_NESTABLE }, {"UL", html_ul, NULL, 2, ET_NESTABLE },
{"VIDEO", html_video, NULL, 1, ET_NON_PAIRABLE},
{"XMP", html_xmp, html_xmp_close, 2, ET_NESTABLE }, {"XMP", html_xmp, html_xmp_close, 2, ET_NESTABLE },
{NULL, NULL, NULL, 0, ET_NESTABLE }, {NULL, NULL, NULL, 0, ET_NESTABLE },
}; };