NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Other Clients Old Stuff (legacy) nDroid v
« Previous 1 2 3 4 5 … 7 Next »
video playback on android

 
  • 0 Vote(s) - 0 Average
video playback on android
reven
Offline

Posting Freak

Posts: 5,782
Threads: 396
Joined: Sep 2004
#11
2014-01-22, 07:57 AM
my videoview is basically just this
Code:
VideoView videoView = (VideoView)findViewById(R.id.videoView1);
videoView.setMediaController(new MediaController(this));
String url = getIntent().getStringExtra("URL");
videoView.setVideoURI(Uri.parse(url));
        
videoView.requestFocus();
videoView.start();
works with some URLs i tried, but if i download the same file, try and stream it using nextpvrs stream?f=[filename], it just doesnt work. i spent about an hour trying to write a custom streamer to get it to work, but each different approach i tried resulted in failed playback. then i discovered some devices just dont support it.

the costar is cheap enough, just will cost me about USD$200 once i pay for the extra shipping + power converter plus about 2 weeks shipping. whereas the netgear neo was about $150USD all up and arrived in 3 days.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,589
Threads: 385
Joined: Dec 2004
#12
2014-01-22, 08:57 AM
Code:
public class VideoPlayer extends Activity {

    VideoView videoView;
    MediaController controller;
    Uri videoURI = Uri.parse("http://192.168.0.5:7648");

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ndroidte_video_player);

        try {
            videoView =(VideoView) findViewById(R.id.videoView);

            controller = new MediaController(this);
            controller.setAnchorView(videoView);

            videoView.setMediaController(controller);
            videoView.setVideoURI(videoURI);
            videoView.requestFocus();

            videoView.setOnPreparedListener(new OnPreparedListener() {
                public void onPrepared(MediaPlayer mp) {
                    videoView.start();
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
VideoView is basically a wrapper class for a MediaPlayer instance and associated SurfaceView. When you call the setVideoURI(...) method on VideoView it calls the prepareAsync() method of the MediaPlayer which is why the OnPreparedListener is used to call videoView.start() as it ensures a connection has been established and there's a level of buffering in place.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


Possibly Related Threads…
Thread Author Replies Views Last Post
  Anyone using nDroid TE on devices running Android less than v4? bgowland 4 6,949 2016-11-03, 02:09 AM
Last Post: mrred128
  Transcoding Live TV to Android t^2 21 10,673 2013-12-31, 07:33 PM
Last Post: bgowland
  Cant play video ndroid TE fuzzweed 10 6,076 2013-07-23, 06:42 PM
Last Post: fuzzweed
  This video cannot be played. fuzzweed 3 2,354 2013-02-25, 06:40 AM
Last Post: fuzzweed
  VIdeo Player for NDroid skl111 6 3,913 2012-12-31, 09:15 AM
Last Post: odin

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode