Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-10526

Android: Video created with object tag inside a webview does not automatically stop when the window/app is closed

    Details

      Description

      When you create a video in a webview with object tag (HTML5), the video doesn't automatically stop when the window/app is closed.

      Repo Steps

      1. Run the below code in app.js
      2. Click back button and you can still hear the video playing in the background.

      (function() {
          var window = Titanium.UI.createWindow({
              left : Titanium.Platform.displayCaps.platformWidth,
              backgroundColor : '#787878',
              navBarHidden : true,
              opacity : 0.0,
              layout : 'absolute'
          });
          var webView = Titanium.UI.createWebView({
              top : 0,
              scalesPageToFit : true,
              left : 0,
              width :'100%',
              showScrollbars : false,
              willHandleTouches : false,
              disableBounce: false,
              pluginState: Titanium.UI.Android.WEBVIEW_PLUGINS_ON
          });
          var html = 
          '<html>' + 
              '<head>' +
                 '<meta name="viewport" content="width=device-width,user-scalable=yes,initial-scale=1">' +
              '</head>' + 
              '<body>' +
                '<P>Video 1</P><P><div class="video_callout" style="width:330px;height:275px;">'+
                '<script language="JavaScript" type="text/javascript" src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>'+
       
       
                '<object id="myExperience1301289234001" class="BrightcoveExperience">'+
                 '<param name="bgcolor" value="white" />' +
                 '<param name="width" value="480" />' +
                 '<param name="height" value="270" />' +
                 '<param name="playerID" value="1052840410001" />' +
                 '<param name="playerKey" value="AQ~~,AAAABokGock~,bQUst1ZshUkZ7AWyIRKjmoefLfGQUFYx" />' +
                 '<param name="isVid" value="true" />' +
                 '<param name="isUI" value="true" />' +
                 '<param name="dynamicStreaming" value="true" />' +
                 '<param name="@videoPlayer" value="1301289234001" />' +
                '</object>' +
       
                '<script type="text/javascript">brightcove.createExperiences();</script>' +
       
       
               '</body>' + 
            '</html>';
         webView.html = html;
         window.add(webView);
         window.addEventListener('close',function(){
         Ti.API.info('window closing');
      });
         window.open();
      })();
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                nsharma Nikhil Sharma
              • Watchers:
                0 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5787
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code