android-videoview

Media player using YouTube?

╄→尐↘猪︶ㄣ 提交于 2019-11-27 21:37:52
I am developing a sample application using MediaPlayer .By using the raw resources folder,the video can be played.But I want to play through URL .How can I achieve this? My code is: VideoView videoView = (VideoView) findViewById(R.id.VideoView); MediaController mediaController = new MediaController(this); mediaController.setAnchorView(videoView); // Set video link (mp4 format ) Uri video = Uri.parse("http://www.youtube.com/watch?v=T1Wgp3mLa_E"); videoView.setMediaController(mediaController); videoView.setVideoURI(video); videoView.start(); bettlebrox You need to get the correct streaming(rtsp)

I want to play a video from my assets or raw folder

我是研究僧i 提交于 2019-11-27 19:29:57
I want to play a video from my assets or raw folder in my app in Android using VideoView I am getting the error as video cannot be played please anyone give me a solution. Here is the code I used VideoView vd = (VideoView)findViewById(R.id.Video); Uri uri = Uri.parse("android.resource:" + R.raw.video); MediaController mc = new MediaController(this); vd.setMediaController(mc); vd.setVideoURI(uri); vd.start(); A few things to note: You must copy the video into your project's res/raw folder. It must be in a supported format (3gp, wmv, mp4 ) and named with lower case, numerics, underscores and

How to play Youtube videos in Android Video View?

戏子无情 提交于 2019-11-27 18:09:22
I am developing an android application which requires a youtube video player embedded within it. I successfully got the RTSP video URL from the API, but while trying to load this rtsp url in my android video view, it says " Can't play this video. ". Previously I developed a similar application in this method, and it worked fine at that time, but it also failing to load now. I'm sure about that, I'm getting the correct RTSP url from the API. rtsp://v6.cache6.c.youtube.com/CiULENy73wIaHAlV9VII3c64lRMYESARFEgGUglwbGF5bGlzdHMM/0/0/0/video.3gp Here is my activity code: mVideoURL = getIntent()

How to play .mp4 video in videoview in android?

早过忘川 提交于 2019-11-27 18:08:29
I am working on video player application, I want to play .mp4 video in native videoview. I am not able to play video using url . I am getting error Sorry this video cannot be played and also I am not able to play downloaded video in native videoview. My code for playing video in videoview: String mUrl = "http://www.servername.com/projects/projectname/videos/1361439400.mp4"; VideoView mVideoView = (VideoView)findViewById(R.id.videoview) videoMediaController = new MediaController(this); mVideoView.setVideoPath(mUrl); videoMediaController.setMediaPlayer(mVideoView); mVideoView.setMediaController

play streaming in VideoView, convert url to rtsp

大城市里の小女人 提交于 2019-11-27 16:17:49
I need to play youtube video and record video in the same layout. To perform this I search for youtube api and found that android version need to be higher than 2.2, this ok but, i want to use VideoView. I saw some post here about this issue and decide eventually to use this code to watch video in VideoView. videoView = (VideoView) findViewById(R.id.your_video_view); Log.d(TAG,getUrlVideoRTSP(current_url) + " id yotube1 " ); //here type the url... videoView.setVideoURI(Uri.parse(getUrlVideoRTSP(current_url))); videoView.setMediaController(new MediaController(this)); //sets MediaController in

Display a video in a VideoView from Firebase URL in Android

為{幸葍}努か 提交于 2019-11-27 16:17:43
When I run my app I'm having these issues. A black screen flashes for 2 secs and then displays the actual intent of my app. The video gets started and when I scroll up/down, the VideoView turns white and continues playing. Not able to see the video but plays in background. After playing is done, for few seconds I'm getting this "Can't play this video" dialog. This is the excerpt from my Adapter Code: public class MessageAdapter extends ArrayAdapter<Message> { private static class ViewHolder { TextView authorTextView, timeStamp, messageTitle, messageTextView; VideoView videoView; ImageView

How to get RTSP Links Android

狂风中的少年 提交于 2019-11-27 14:28:42
Am having you-tube links like http://www.youtube.com/v/YR71GnQ4CU4?f=videos&app=youtube_gdata , then how to convert it to RTSP format to play in VideoView. Am searching gdata api with this: http://gdata.youtube.com/feeds/api/videos?&max-results=20&v=2&format=1&q= "+ URLEncoder.encode(activity.criteria) but i cant find how to get related RTSP url. I got my answer ..thanx to this Element rsp = (Element)entry.getElementsByTagName("media:content").item(1); String anotherurl=rsp.getAttribute("url"); In gdata api only we are getting this type of links : rtsp://v3.cache7.c.youtube.com

Android — Can't play any videos (mp4/mov/3gp/etc.)?

血红的双手。 提交于 2019-11-27 13:48:46
I'm having great difficulty getting my Android application to play videos from the SD card. It doesn't matter what size, bitrate, video format, or any other setting I can think of, neither the emulator nor my G1 will play anything I try to encode. I've also tried a number of videos from the web (various video formats, bitrates, with and without audio tracks, etc.), and none of those work either. All I keep getting is a dialog box that says: "Cannot play video" "Sorry, this video cannot be played." There are errors reported in LogCat, but I don't understand them and I've tried searching the

Android Scrollview having videoview is giving problem

房东的猫 提交于 2019-11-27 08:30:39
I have a VideoView that is inside a scrollView. When I scroll the scrollView, the VideoView does not scroll with it. It is like its position is fixed. Here is my layout: <?xml version="1.0" encoding="utf-8" ?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#FFFFFF"> <LinearLayout android:id="@+id/BackBar" android:orientation="vertical" android:layout_width="fill_parent" android:paddingTop="2dp" android:layout_height="wrap_content" android

Avoid Android VideoView corruption when rotating back to portrait

拈花ヽ惹草 提交于 2019-11-27 08:29:00
I've managed to write a limited video player able to view a .3gp file from internet. The video will be shown centered full screen, maintaining the video aspect ratio. Also, rotations don't interrupt the video, which keeps playing without problems. Everything seems fine, but... on my HTC Legend when you rotate back to portrait, the video is corrupted, and instead of showing full screen it is displayed at its native pixel size. But rotating again to landscape works and is shown perfectly. Any ideas why? Unfortunately I don't have more hardware to test this on and I've run out of ideas to test.