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

Android: Videoplayer events do not work well on Android lollipop

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      testing with nexus 5, running stock android 5.1
      Titanium SDK 3.5.1.GA

      Description

      The 'complete' event does not seem to fire from the VideoPlayer closes, nor does the click handler for the "Exit Video" button I added fire when I hit "Exit Video", but the VideoPlayer does close. Using the "back" button on the device itself to close the video player does not cause 'complete' to fire either.

      I have some code similar to the following:

      function openPlayer(e) {
        var videoPlayer = Ti.Media.createVideoPlayer({
          url: "/demo.mp4",
          mediaControlStyle: Titanium.Media.VIDEO_CONTROL_FULLSCREEN,
          scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
          fullscreen: true,
          autoplay: true
        });
       
        var closeButton = Ti.UI.createButton({
          title: "Exit Video",
          top: "0dp",
          height: "40dp",
          left: "10dp",
          right: "10dp"
        });
       
        closeButton.addEventListener('click', function() {
          videoPlayer.hide();
          videoPlayer.release();
          videoPlayer = null;
        });
       
        videoPlayer.add(closeButton);
       
        videoPlayer.addEventListener('load', function(player) {
          console.log("loaded");
        });
       
        videoPlayer.addEventListener('keypressed', function(e) {
          console.log("keypressed");
        });
        videoPlayer.addEventListener('complete', function(player) {
          console.log("DONE");
        });
        videoPlayer.addEventListener('playing', function(player) {
          console.log("playing");
        });
        videoPlayer.addEventListener('error', function(player) {
          console.log("error");
        });
      }
       
      function onClick(e) {
        openPlayer(null);
      }
      $.btn_open.addEventListener("click", onClick);
      $.index.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                willwh William Hetherington
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Backbone Issue Sync

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

                    Git Source Code