http://www.mediawiki.org/wiki/Special:Code/MediaWiki/58297
Revision: 58297 Author: dale Date: 2009-10-29 02:48:13 +0000 (Thu, 29 Oct 2009) Log Message: ----------- * added default 0 height for audio tags Modified Paths: -------------- trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js Added Paths: ----------- trunk/phase3/js2/mwEmbed/example_usage/Player_Audio.html Added: trunk/phase3/js2/mwEmbed/example_usage/Player_Audio.html =================================================================== --- trunk/phase3/js2/mwEmbed/example_usage/Player_Audio.html (rev 0) +++ trunk/phase3/js2/mwEmbed/example_usage/Player_Audio.html 2009-10-29 02:48:13 UTC (rev 58297) @@ -0,0 +1,12 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> + <script type="text/javascript" src="../mv_embed.js?debug=true"></script> +<title>Audio Player sample</title> +</head> +<body> +<h3> Audio Player </h3> +<audio src="http://upload.wikimedia.org/wikipedia/commons/4/4c/Faurepiece.ogg" durationHint="164"></audio> +</body> +</html> \ No newline at end of file Modified: trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js =================================================================== --- trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js 2009-10-29 00:34:37 UTC (rev 58296) +++ trunk/phase3/js2/mwEmbed/libEmbedVideo/embedVideo.js 2009-10-29 02:48:13 UTC (rev 58297) @@ -153,8 +153,7 @@ mvEmbed.swapEmbedVideoElement( this_elm, videoInterface ); break; case 'audio': - var videoInterface = new embedVideo(this_elm); - videoInterface.type ='audio'; + var videoInterface = new embedVideo(this_elm); mvEmbed.swapEmbedVideoElement( this_elm, videoInterface ); break; case 'playlist': @@ -213,8 +212,8 @@ //make sure our div has a hight/width set: $j(embed_video).css({ - 'width':videoInterface.width, - 'height':videoInterface.height + 'width' : videoInterface.width, + 'height' : videoInterface.height }).html( mv_get_loading_img() ); //inherit the video interface for(var method in videoInterface){ //for in loop oky in Element context @@ -782,7 +781,7 @@ //for seek thumb updates: cur_thumb_seek_time:0, thumb_seek_interval:null, - + //set the default tag type to video: seeking:false, //set the buffered percent: bufferedPercent:0, @@ -839,10 +838,16 @@ //make sure duration is in float: this.duration = parseFloat(this.duration); js_log("duration is: " + this.duration); - //if style is set override width and height + + //get defaults var dwh = $mw.conf['video_size'].split('x'); - this.width = element.style.width ? element.style.width : dwh[0]; - this.height = element.style.height ? element.style.height : dwh[1]; + this.width = element.style.width ? element.style.width : dwh[0]; + if( element.tagName == 'AUDIO' ){ + this.height = element.style.height ? element.style.height : 0; + }else{ + this.height = element.style.height ? element.style.height : dwh[1]; + } + //set the plugin id this.pid = 'pid_' + this.id; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs