android-videoview

Online Video not Playing

血红的双手。 提交于 2019-12-04 11:34:47
I'm following a Tutorial to play Video in Android, Tutorial Here But when I run the Application on Emulator, it Gives me the following Error MediaPlayer error (1, -2147483648) Please Help Here's the Code of my Application JAVA package com.example.videoplayer; import android.media.MediaPlayer; import android.media.MediaPlayer.OnErrorListener; import android.media.MediaPlayer.OnPreparedListener; import android.net.Uri; import android.os.Bundle; import android.app.Activity; import android.content.Context; import android.graphics.PixelFormat; import android.util.Log; import android.view.Menu;

Android: VideoView within Fragment only playing audio, not displaying video

笑着哭i 提交于 2019-12-04 09:42:06
问题 I have a fragment that allows users to select from a mixed list of video and image content. When selecting a multimedia item, display is toggled between an ImageView and VideoView depending on the media type. The problem is, when the user selects a video, only the audio is played, and the VideoView remains black. This is the code for displaying video: (Most of the code at the bottom is trial-and-error to see if something is missing to fix this issue) mainVideo.setVisibility(View.VISIBLE);

Android VideoView - Detect point of time in video

谁都会走 提交于 2019-12-04 08:54:47
I am using a VideoView to display a video. I am using setOnPreparedListener and setOnCompletionListener to do stuff before and after the video starts and ends. I was wondering how I could go about detecting some point of time in the video. For eg, say I want to write log to a file when the video has played for 10s. How can I detect the 10s mark? Thanks Chris Step #1: Use postDelayed() or something to get control every second or so. Step #2: Check getCurrentPosition() and see if it is near your desired marker point. If so, do your processing. Step #3: Lather, rinse, repeat. There is no

VideoView force close on Micromax Canvas magnus

我怕爱的太早我们不能终老 提交于 2019-12-04 08:26:08
Why VideoView force closes on Micromax Canvas magnus ? java.lang.StringIndexOutOfBoundsException: length=11; regionStart=0; regionLength=-1 at java.lang.String.startEndAndLength(String.java:583) at java.lang.String.substring(String.java:1464) at android.widget.VideoView.openVideo(VideoView.java:407) at android.widget.VideoView$6.surfaceCreated(VideoView.java:730) at android.view.SurfaceView.updateWindow(SurfaceView.java:606) at android.view.SurfaceView.access$000(SurfaceView.java:88) at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:183) at android.view.ViewTreeObserver

Android Video not fitting the width in portrait of the videoview and not occupying full screen in landscape

时光怂恿深爱的人放手 提交于 2019-12-04 07:38:28
Android video not fitting the width of the videoview when in portrait, how can i make the width of my video fit the width of my videoview when in portrait, and when i change orientation of the screen to landscape i would like the video to fill the whole screen like the youtube app does. when in portrait the video is to start from the top to the middle of the screen and and when in landscape to fill the whole screen. here is what i have tried, i have also add links of the complete screenshot <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill

seekTo in VideoView

江枫思渺然 提交于 2019-12-04 07:09:37
I'm having problems with seeking video. My application should resume video from place where it was stopped last time. So I do this: videoView.seekTo(bookmark); videoView.start(); However when it plays I hear sounds form beginning of video for about 1-2 sec. And only after that video seeks to the right position. This behavior is reproducible on HTC Nexus One, HTC G1, HTC evo. But on Samsung galaxy tab all plays normally. Anybody had similar problems? Is this bug HTC-specific? Thanks in advance. I guess that can be a reason: from api doc Although the asynchronuous seekTo(int) call returns right

RTSP 1080p live-streaming android client gets error (100,0)

半城伤御伤魂 提交于 2019-12-04 05:55:06
My new surveillance camera just arrived, so I'm trying to write an app to live stream the video from it. Since it came with basically no documentation, I installed the 'onvifer' android app which allows you to browse the camera's capabilities. This app works fine - gets the video and allows PTZ controls, etc. It reports the streaming url as: rtsp://192.1.0.193:554/mpeg4 I tested the stream in the VLC windows client, and it's able to stream video from that URL as well. This makes me comfortable that the network is working OK. The camera states the feed will be 1920x1080; VLC confirms this. The

How To toggle FullScreen with VideoView Android

╄→гoц情女王★ 提交于 2019-12-04 05:25:28
I am using video view for live streaming, and I want to make this VideoView to toggle fullscreen and back to small screen like MXPlayer or YouTube players do without stopping the streams. <ScrollView android:id="@+id/scrollview" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/ad_container" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" android:background="@android:color/transparent" > <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@android:color

Draw overlay (HUD) on Android VideoView?

◇◆丶佛笑我妖孽 提交于 2019-12-04 04:04:57
I have a custom view that draws HUD : Here is my layout: <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <VideoView android:id="@+id/videoView1" android:layout_gravity="center" android:layout_width="match_parent" android:layout_height="wrap_content" /> <com.widgets.HUD android:id="@+id/hud" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </FrameLayout> public View onCreateView(LayoutInflater inflater,

android play movie inside expansion file

▼魔方 西西 提交于 2019-12-04 03:30:37
My app is trying to deliver lots of contents to users, so the app's size is much greater than 50mb. There is no way we could reduce or remove some of the content, so we decided to go with the expansion approach. I am trying to follow this tutorial: Android APK Expansion Files , and have been successful up to putting the expansion file into my device for testing. I could get the input stream of any video file inside the expansion. But when I try to setVideoUri for the videoView, it starts crashing. Here are some code: ZipFileContentProvider contentProvider = new ZipFileContentProvider(); String