1

I am trying to utilise RTMPGW as part of my app, which usually works great in Linux. I am trying to use the Vitamio bundle to play back the stream. Here is the main code, taken from the Vitamio Demo:

package io.vov.vitamio.demo;

import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;
import android.app.Activity;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;

public class VideoViewDemo extends Activity {


    private VideoView mVideoView;

    /* (non-Javadoc)
     * @see android.app.Activity#onCreate(android.os.Bundle)
     */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
            return;

    setContentView(R.layout.videoview);
    mVideoView = (VideoView) findViewById(R.id.surface_view);
    mVideoView.setVideoURI(Uri.parse("http://172.16.1.182:8902/?r=rtmp://live.dtv.cubecdn.net:80/kdmobil/KanalD1&W=http://www.kanald.com.tr/Content/swf/Canliplayer6.swf?config=/Content/swf/Config.xml%26debug=false&p=http://www.kanald.com.tr&c=80"));
    mVideoView.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
    mVideoView.setMediaController(new MediaController(this));
    mVideoView.requestFocus();
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        if (mVideoView != null)
            mVideoView.setVideoLayout(VideoView.VIDEO_LAYOUT_SCALE, 0);
        super.onConfigurationChanged(newConfig);
    }
}

When I run this, RTMPGW (which I am running from the terminal in Linux) displays this error:

processTCPrequest, Range request not supported

..and sits there idly, doing nothing.

However, when I use regular Android VideoView with this code (in a different project):

package com.sample.videoviewexample;

import android.app.Activity;
import android.net.Uri;
import android.os.Bundle;
import android.widget.MediaController;
import android.widget.VideoView;

public class MainActivity extends Activity {
   private VideoView mVideoView;

   @Override
   public void onCreate(Bundle icicle) {
     super.onCreate(icicle);
     setContentView(R.layout.activity_main);
     mVideoView = (VideoView) findViewById(R.id.surface_view);
     mVideoView.setVideoURI(Uri.parse("http://172.16.1.182:8902/?r=rtmp://live.dtv.cubecdn.net:80/kdmobil/KanalD1&W=http://www.kanald.com.tr/Content/swf/Canliplayer6.swf?config=/Content/swf/Config.xml%26debug=false&p=http://www.kanald.com.tr&c=80"));
     mVideoView.setMediaController(new MediaController(this));
     mVideoView.requestFocus();
   }
}

It connects to the RTMPGW server and starts streaming like so...

Streaming on http://0.0.0.0:8902
processTCPrequest, Range request not supported
Connecting ... port: 80, app: kdmobil/KanalD1
1094.914 KB / 16.90 sec

But, of course, as Android MediaPlayer doesn't support Flash natively it won't play back the video.

Why does the VideoView connect with RTMPGW's server but Vitamio doesn't?

Thanks for your help,

Dan

Dan Turner
  • 171
  • 1
  • 11

0 Answers0