Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-18913] Android: VideoPlayer is not playing mp4 videos anymore on Android L/Lollipop/5

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-07-08T22:39:32.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.0.0
ComponentsAndroid
Labelsn/a
ReporterAppDev
AssigneeAshraf Abu
Created2015-05-06T14:35:20.000+0000
Updated2015-08-17T20:52:39.000+0000

Description

*Description:* Video playback on Android L seems broken with SDK 3.5.1 (and 4.0.0RC2). MP4 files do not show video and audio output. *How to reproduce:* Run the attached app.js on a Android L device. Code is taken from http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Media.VideoPlayer. *What should happen:* Video should be played after the app is deployed. *What does happen:* Blank/Black VideoPlayer, no video is played, no sound. After several seconds the console shows (both of them!): [ERROR] : MediaPlayer: error (1, -2147483648) [ERROR] : MediaPlayer: Error (1,-2147483648) Nothing more changes. Setting autoplay to false and adding a call to .play on the VideoPlayer object creates this log message: [WARN] : VideoPlayerProxy: (main) [101,101] Player action ignored; player has not been created. *Where does it work:* The same app does work on a Nexus 10 device running Android 4.4.4 (KitKat). It does not work either on other devices running Android 5.0.2 and 5.1. It does work in iOS simulator. It does not work with Ti SDK 4.0.0RC2 on Android 5.1. Several different mp4 files do not work either in the environment described.

Attachments

FileDateSize
app.js2015-05-06T14:32:16.000+0000710
Screenshot_2015-05-06-16-32-14.png2015-05-06T14:33:39.000+000022137

Comments

  1. AppDev 2015-05-06

    I just see this is probably wrong here, I think it would belong to Project TIMOB. Can somebody move this or tell me where to do that myself? Sorry for the inconvenience!
  2. AppDev 2015-05-06

  3. Lokesh Choudhary 2015-05-12

    This issue is reproducible . Mp4 flies don't play on android Lollypop. Environment: Appc Studio : 4.0.0.201505120319 Ti SDK : 4.0.0.v20150512005012, 3.5.1.GA CLI : 4.0.0-beta8 Alloy : 1.6.0-beta4 MAC Yosemite : 10.10.3 Appc npm : 0.3.55 Appc CLI : 0.2.282 Node: v0.10.37 Android : 5.0.2 , 4.4.4
  4. David Benko 2015-06-10

    I'm able to reproduce this problem Android 5.1.1 Titanium SDK 3.5.1 From the logs when I open the VideoPlayer: 06-09 21:17:46.216: E/ExtMediaPlayer-JNI(6914): QCMediaPlayer could not be located.... 06-09 21:17:46.216: E/MediaPlayer-JNI(6914): QCMediaPlayer mediaplayer NOT present .... 06-09 21:18:16.786: E/MediaPlayer(6914): error (1, -2147483648) 06-09 21:18:16.787: E/MediaPlayer(6914): Error (1,-2147483648) And the VideoPlayer closes Is there any ETA on this issue? This is very critical for my video app
  5. Arthur Padilha 2015-06-11

    I had the same issue with in my application. Android 5.1.1 / Ti SDK 3.5.1 The video doesn't start playing. The core functionallity of my app is video reproducing, please fix this issue!
  6. Brad Ball 2015-06-16

    Same issue here. Seriously no one is working on this???
  7. Hieu Pham 2015-06-16

  8. Brad Ball 2015-06-16

    Really? The remote video sample in the Kitchen Sink app doesn't work for me using the nightly build from June 16...
  9. David Benko 2015-06-19

    Tested against 4.1.0.v20150618212032 and it has not been fixed {quote} 06-19 12:05:48.134: W/VideoPlayerProxy(476): (KrollRuntimeThread) [104191,255306] movieControlMode is deprecated. Use mediaControlStyle instead. 06-19 12:05:48.134: I/Timeline(476): Timeline: Activity_launch_request id:com.test time:85199265 06-19 12:05:48.230: W/VideoPlayerProxy(476): (main) [96,255402] Player action ignored; player has not been created. 06-19 12:05:48.231: W/VideoPlayerProxy(476): (main) [1,255403] Player action ignored; player has not been created. 06-19 12:05:48.364: E/ExtMediaPlayer-JNI(476): QCMediaPlayer could not be located.... 06-19 12:05:48.364: E/MediaPlayer-JNI(476): QCMediaPlayer mediaplayer NOT present 06-19 12:05:48.365: D/MediaPlayer(476): Couldn't open file on client side, trying server side 06-19 12:05:48.377: D/MediaHTTPConnection(476): filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 5.1.1) 06-19 12:05:48.380: D/MediaHTTPConnection(476): proxy null port 0 06-19 12:05:48.496: I/Timeline(476): Timeline: Activity_idle id: android.os.BinderProxy@33198afa time:85199627 06-19 12:05:50.985: D/MediaHTTPConnection(476): proxy null port 0 06-19 12:05:51.337: W/MediaHTTPConnection(476): readAt 31019992 / 32768 => java.net.ProtocolException 06-19 12:05:51.353: E/MediaPlayer(476): Should have subtitle controller already set 06-19 12:05:51.439: D/MediaHTTPConnection(476): filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 5.1.1) 06-19 12:05:51.442: D/MediaHTTPConnection(476): proxy null port 0 06-19 12:05:51.629: W/MediaHTTPConnection(476): readAt 292920 / 32768 => java.net.ProtocolException 06-19 12:05:51.730: D/MediaHTTPConnection(476): filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 5.1.1) 06-19 12:05:51.732: D/MediaHTTPConnection(476): proxy null port 0 06-19 12:05:51.897: W/MediaHTTPConnection(476): readAt 293432 / 32768 => java.net.ProtocolException 06-19 12:05:52.090: E/MediaPlayer(476): error (1, -1004) 06-19 12:05:52.091: E/MediaPlayer(476): Error (1,-1004) 06-19 12:05:52.091: D/TiVideoView8(476): (main) [3860,259263] Error: 1,-1004 06-19 12:05:52.390: E/MediaPlayer(476): error (1, -1004) 06-19 12:05:52.417: I/Timeline(476): Timeline: Activity_idle id: android.os.BinderProxy@163007b0 time:85203548 {quote}
  10. Ashraf Abu 2015-06-22

    PR: https://github.com/appcelerator/titanium_mobile/pull/6928 Test code in PR. Test with an Android 5.1.1 or above.
  11. Josh Lewis 2015-06-24

    Any updates? Doesn't work on my Nexus with 5.1 (Lollipop), video never loads, using the 3.5 AND 4.0
  12. Ashraf Abu 2015-06-26

    [~josh.lewis] Is there a sample link that you could provide that you are using this with?
  13. Josh Lewis 2015-06-26

    This one loads fine http://s3.amazonaws.com/playbackacp.com/2013MOC/10.Reynolds.mp4 This one does NOT http://s3.amazonaws.com/playbackacp.com/865/challenge_2/865-01-05.mp4 Using the regular player sample code, nothing fancy. Both work in iOS
  14. Josh Lewis 2015-07-01

    I don't really know what that means. Are you saying track down the java class everytime I compile and change it somehow?
  15. David Benko 2015-07-07

    @Ashraf Abu Another sample link that doesn't work: http://108.59.9.98/big_buck_bunny.mp4
  16. Ashraf Abu 2015-07-08

    [~davidbenko] Will look into it. Thanks. [~josh.lewis] I'm currently looking into this. Once it's fixed, you shouldn't need to do anything except get the latest Titanium SDK.
  17. Ashraf Abu 2015-07-08

    Just an update for watchers, this ticket was resolved with the PR: https://github.com/appcelerator/titanium_mobile/pull/6928
  18. Brad Ball 2015-07-09

    Thanks @Ashraf Abu! Any way I can get this fix into my current (4.0.0) sdk? I've never compiled the titanium sdk myself. Or is there some (stable) compiled version I can download that includes this fix?
  19. Ashraf Abu 2015-07-10

    Hi [~bradleycorn]. This is going to be released in 4.2.0 which is the next release. (4.1.0.GA just got released http://www.appcelerator.com/blog/2015/07/4-1-0-ga-now-available/) If you really need to get the bleeding edge functionality and the most recent bug fixes to the Titanium SDKs, without waiting for an official release, you can try http://docs.appcelerator.com/platform/latest/#!/guide/Installing_Titanium_SDK_Continuous_Builds This particular fix would be available in the Master branch.
  20. Josh Lewis 2015-07-10

    That still doesn't seem to fix it. Make a simple app that loads a videoplayer and use this url, and you'll see it doesn't work. https://s3.amazonaws.com/playbackacp.com/865/challenge/865-01-03.mp4
  21. Lokesh Choudhary 2015-07-10

    [~joshlewis], The url works for me with the latest 4.2.0 SDK (master) which is not out yet. Which titanium SDK & android version you checked it with ? Tested with these components: Appc Studio : 4.1.0.201507071122 Ti SDK : 4.2.0.v20150710092422 Ti CLI : 4.0.1 Alloy : 1.6.2 MAC Yosemite : 10.10.4 Appc NPM : 4.1.0 Appc CLI : 4.1.0 Node: v0.10.37 Nexus 5 - Android 5.1.1
  22. Josh Lewis 2015-07-11

    My mistake, it did work on the emulator. Will this not work on Kitkat, since its the most popular right now? Lolipop is only at about 2%, KitKat is almost 40%.
  23. Ashraf Abu 2015-07-13

    Tested with Galaxy S5, SM-G900F that is on 4.4.2 (KitKat). Works fine. This fix was for Android Lollipop.
  24. Lokesh Choudhary 2015-07-13

    Verified the fix. Tested with the code below with multiple url's:
        var vidWin = Titanium.UI.createWindow({
            title : 'Video View Demo',
            backgroundColor : '#fff'
        });
        
        var videoPlayer = Titanium.Media.createVideoPlayer({
            top : 2,
            autoplay : true,
            backgroundColor : 'blue',
            height : 300,
            width : 300,
            mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
            scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
            //url : 'http://s3.amazonaws.com/playbackacp.com/865/challenge_2/865-01-05.mp4' //This video takes some time to load.
            //url : 'http://player.vimeo.com/external/121659103.sd.mp4?s=b04ddefe800446e09bd2cdf7e6193aa9'
            //url : 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
            //url : 'http://108.59.9.98/big_buck_bunny.mp4'
            //url : 'http://dts.podtrac.com/redirect.mp4/twit.cachefly.net/video/aaa/aaa0033/aaa0033_h264b_640x368_256.mp4'
            url: 'https://s3.amazonaws.com/playbackacp.com/865/challenge/865-01-03.mp4'
            //url: 'http://www.html5videoplayer.net/videos/toystory.mp4'
        });
        
        
        vidWin.add(videoPlayer);
        vidWin.open();
        
    The video's play fine on android lollipop. Closing. Environment: Appc Studio : 4.1.0.201507071122 Ti SDK : 4.2.0.v20150710092422 Ti CLI : 4.0.1 Alloy : 1.6.2 MAC Yosemite : 10.10.4 Appc NPM : 4.1.0 Appc CLI : 4.1.0 Node: v0.10.37 Nexus 5 - Android 5.1.1, Android 5.0 Samsung Galaxy S4 - Android 4.4.2
  25. Amimul Hossain 2015-07-14

    Verified the fix. In SDK 4.1.0.GA Tested with the code below with multiple url's:
        var vidWin = Titanium.UI.createWindow({
            title : 'Video View Demo',
            backgroundColor : '#fff'
        });
         
        var videoPlayer = Titanium.Media.createVideoPlayer({
            top : 2,
            autoplay : true,
            backgroundColor : 'blue',
            height : 300,
            width : 300,
            mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
            scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT,
            //url : 'http://player.vimeo.com/external/121659103.sd.mp4?s=b04ddefe800446e09bd2cdf7e6193aa9'
            //url : 'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'
            //url : 'http://108.59.9.98/big_buck_bunny.mp4'
            //url : 'http://dts.podtrac.com/redirect.mp4/twit.cachefly.net/video/aaa/aaa0033/aaa0033_h264b_640x368_256.mp4'
            url: 'https://s3.amazonaws.com/playbackacp.com/865/challenge/865-01-03.mp4'
            //url: 'http://www.html5videoplayer.net/videos/toystory.mp4'
        });
         
         
        vidWin.add(videoPlayer);
        vidWin.open();
        
    The video's play fine on android lollipop. Environment: Appcelerator Studio, build: 4.1.0.201507071122 Ti SDK : 4.1.0.GA CLI : 3.4.1 Alloy : 1.6.2 MAC Yosemite : 10.10.4 Appc NPM : 4.1.0 Appc CLI : 4.1.0 Node: v0.10.37 Nexus 7 - Android 5.1.1, Android 5.0
  26. Eduardo Silva 2015-08-17

    In my tests the error still happens in Android 4.2.2. (Genymotion Emulator: Motorola Moto X - 4.2.2 - API 17 - 720x1280) Using the sdk build: 4.2.0.v20150815030432 The link to a alloy project is here: https://www.dropbox.com/s/rocwpcy4jvnwzhd/vimeoPlayer-test.zip?dl=0
        var Player = {
        
          win: null,
          videoPlayer: null,
          isPlaying: false,
        
          play: function(_id) {
            Player.isPlaying = true;
            Player.getVideo(_id);
          },
        
          getVideo: function(_id) {
            var vimeoVideoConfig = 'http://player.vimeo.com/video/' + _id + '/config';
            console.log("vimeoVideoConfig:", vimeoVideoConfig);
        
            var xhr = Titanium.Network.createHTTPClient({ timeout : 10000  /* in milliseconds */});
            xhr.open("GET", vimeoVideoConfig);
            xhr.onerror = function(_error) {
              Ti.API.log('Player ERROR:', _error);
            };
            xhr.onload = function(){
              var response = JSON.parse(this.responseText);
              var videoUrl;
        
              try {
                videoUrl = response.request.files.h264.mobile.url
              } catch(e) {
                videoUrl = response.request.files.h264.sd.url
              }
        
              Player.playVideo(videoUrl);
            };
            xhr.send();
          },
        
          playVideo: function(url) {
            Ti.API.log("playVideo:", url);
            
            Player.videoPlayer = Ti.Media.createVideoPlayer({
              backgroundColor: '#000',
              fullscreen: true,
              autoplay: true,
              url: url,
              scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
              mediaControlMode: Ti.Media.VIDEO_CONTROL_DEFAULT 
            });
        
            if(OS_IOS) {
              Player.win = Ti.UI.createWindow({
                backgroundColor: '#000',
                modal: true,
                opacity: 0
              });
            }
        
            Player.videoPlayer.addEventListener('complete', function(e) { 
              Player.close();
            });
            Player.videoPlayer.addEventListener('fullscreen', function(e) {
              if (!e.entering) {
                Player.close();
              }
            });
        
            if(OS_IOS) {
              Player.win.add(Player.videoPlayer);
              Player.win.open();
            }
        
          },
        
          close: function() {
            if(OS_IOS) {
              Player.videoPlayer.fullscreen = false;
              Player.win.close();
            } else {
              Player.videoPlayer.hide();
              Player.videoPlayer.release();
              Player.videoPlayer = null;
            }
            Player.isPlaying = false;
          }
        
        };
        
        module.exports = Player;
        
        function doClick(e) {
            require('vimeo-player').play("123857657");
        }
        
        $.index.open();
        
  27. Josh Lewis 2015-08-17

    It doesn't work on 4x versions of Android, only 5x and up.
  28. Eduardo Silva 2015-08-17

    This means that the videoPlayer does not work with Android 4.x? I tested with Android 4.4.2 and it works.
  29. Lokesh Choudhary 2015-08-17

JSON Source