multimediaview : fix audio control
authorWonseop Kim <wonseop.kim@samsung.com>
Wed, 20 Feb 2013 08:27:14 +0000 (17:27 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Thu, 7 Mar 2013 12:10:31 +0000 (21:10 +0900)
Fixed some codes so that audio control can be displayed with the create event.
And fixed the problem that the control disappeared when it was created again.
Resolves #TDIS-2607, #TDIS-2608

Change-Id: I362fae0efefe478585e1fbf4eed89591ba2e5e2f

src/js/widgets/jquery.mobile.tizen.multimediaview.js

index d1c9d77..16cd54b 100644 (file)
@@ -158,11 +158,12 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
                                option = self.options,
                                parentTheme = $.mobile.getInheritedTheme( view, "s" ),
                                theme = option.theme || parentTheme,
+                               width = viewElement.style.getPropertyValue( "width" ) || "",
+                               wrap = $( "<div class='ui-multimediaview-wrap ui-multimediaview-" + theme + "'>" ),
                                control = null;
 
                        $.extend( this, {
                                role: null,
-                               isControlHide: false,
                                controlTimer: null,
                                isVolumeHide: true,
                                backupView: null,
@@ -172,15 +173,21 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
 
                        view.addClass( "ui-multimediaview" );
                        control = self._createControl();
+                       control.hide();
+
                        control.find( ".ui-button" ).each( function ( index ) {
                                $( this ).buttonMarkup( { corners: true, theme: theme, shadow: true } );
                        });
 
+                       view.wrap( wrap ).after( control );
+
                        if ( isVideo ) {
                                control.addClass( "ui-multimediaview-video" );
+                       } else {
+                               self.width( width );
+                               self.options.fullScreen = false;
                        }
 
-                       view.wrap( "<div class='ui-multimediaview-wrap ui-multimediaview-" + theme + "'>" ).after( control );
                        if ( option.controls && view.attr( "controls" ) ) {
                                view.removeAttr( "controls" );
                        }
@@ -408,9 +415,12 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
                                        return;
                                }
 
-                               control.fadeToggle( "fast", function () {
-                                       self.isControlHide = !self.isControlHide;
-                               });
+                               control.fadeToggle( "fast" );
+                               self._resize();
+                       }).bind( "multimediaviewinit", function ( e ) {
+                               if ( option.controls ) {
+                                       control.show();
+                               }
                                self._resize();
                        });
 
@@ -586,7 +596,6 @@ define( [ '../jquery.mobile.tizen.scrollview' ], function ( ) {
 
                        self.controlTimer = setTimeout( function () {
                                self.isVolumeHide = true;
-                               self.isControlHide = true;
                                self.controlTimer = null;
                                volumeControl.hide();
                                control.fadeOut( "fast" );