* added default 0 height for audio tags
authorMichael Dale <dale@users.mediawiki.org>
Thu, 29 Oct 2009 02:48:13 +0000 (02:48 +0000)
committerMichael Dale <dale@users.mediawiki.org>
Thu, 29 Oct 2009 02:48:13 +0000 (02:48 +0000)
js2/mwEmbed/example_usage/Player_Audio.html [new file with mode: 0644]
js2/mwEmbed/libEmbedVideo/embedVideo.js

diff --git a/js2/mwEmbed/example_usage/Player_Audio.html b/js2/mwEmbed/example_usage/Player_Audio.html
new file mode 100644 (file)
index 0000000..81e89f9
--- /dev/null
@@ -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
index e4fd1d3..55a367b 100644 (file)
@@ -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;