Starting VLC Beta by Intent...
Posted: 31 Jul 2012 15:49
Mod edit and stickied, as this is a very common request.
To start VLC for Android with an intent, you should use Intent.ACTION_VIEW and call VLC with a valid multimedia URI and/or type, like so:
There is an optional extra called position (type 'long') that tells VLC when to start playback, in milliseconds. Please note that not all streams support seeking, and this extra will only work on seekable streams.
For example, you can use it like this to start a stream at 1:00.
Or, if you just want to start _any_ video player without discrimination, you can use an indirect intent like so:
The original posting is preserved below.
-----------------------------------------------------------------------------------------------------------------
Hi i just like to start VLC Beta with an intent. First i tried an indirect intent:
But this one just show me MXPlayer After that i tried to decompile VLC to address the intent explicit:
This one will open the PlayerActivity but i´m not able to start it with the udp-uri...
Any idea how to solve this? I just need a temporary solution till you implement all features!
To start VLC for Android with an intent, you should use Intent.ACTION_VIEW and call VLC with a valid multimedia URI and/or type, like so:
Code: Select all
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse("http://example.com/media/test.mp4"), "application/mp4");
startActivity(intent);
For example, you can use it like this to start a stream at 1:00.
Code: Select all
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage("org.videolan.vlc.betav7neon"); // Use org.videolan.vlc for nightly builds
intent.setDataAndType(Uri.parse("http://127.0.0.1/temp/stream"), "application/mp4");
intent.putExtra("position", (long)60000);
startActivity(intent);
Code: Select all
Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("udp://@10.11.11.11:1111"));
startActivity(in);
-----------------------------------------------------------------------------------------------------------------
Hi i just like to start VLC Beta with an intent. First i tried an indirect intent:
Code: Select all
Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("udp://@111.11.11.11:1111"));
startActivity(in);
Code: Select all
Intent intent = new Intent("org.videolan.vlc.betav7neon");
Uri uri = Uri.parse("udp://@111.11.11.11:1111");
intent.setDataAndType(uri, "video/*");
intent.putExtra("udp", uri);
intent.setClassName("org.videolan.vlc.betav7neon", "org.videolan.vlc.betav7neon.gui.video.VideoPlayerActivity");
startActivity(intent);
Any idea how to solve this? I just need a temporary solution till you implement all features!