From 1197829a28a6dc374b4460be86ec222445ac2da0 Mon Sep 17 00:00:00 2001 From: Michael Dale Date: Thu, 29 Oct 2009 02:48:13 +0000 Subject: [PATCH] * added default 0 height for audio tags --- js2/mwEmbed/example_usage/Player_Audio.html | 12 ++++++++++++ js2/mwEmbed/libEmbedVideo/embedVideo.js | 21 +++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 js2/mwEmbed/example_usage/Player_Audio.html diff --git a/js2/mwEmbed/example_usage/Player_Audio.html b/js2/mwEmbed/example_usage/Player_Audio.html new file mode 100644 index 0000000000..81e89f9b81 --- /dev/null +++ b/js2/mwEmbed/example_usage/Player_Audio.html @@ -0,0 +1,12 @@ + + + + + +Audio Player sample + + +

Audio Player

+ + + \ No newline at end of file diff --git a/js2/mwEmbed/libEmbedVideo/embedVideo.js b/js2/mwEmbed/libEmbedVideo/embedVideo.js index e4fd1d3f40..55a367bc5c 100644 --- a/js2/mwEmbed/libEmbedVideo/embedVideo.js +++ b/js2/mwEmbed/libEmbedVideo/embedVideo.js @@ -153,8 +153,7 @@ mvEmbed = { 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 @@ mvEmbed = { //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 @@ embedVideo.prototype = { //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 @@ embedVideo.prototype = { //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; -- 2.20.1