YouTube, 일일 모션, vimeo 등의 사이트에서 온라인 비디오를 재생하고 싶은 어플리케이션을 만들고 있습니다. 문제는 내가 비디오를 재생하려고 할 때 매일 움직이는 경우 동영상이 재생되지 않고 플레이어가 "네트워크에 문제가 있습니다"라는 오류가 표시됩니다. 내 인터넷 연결이 정상적으로 작동하고 있습니다.Youtube API없이 Android 애플리케이션에서 비디오 재생
내 주요 활동 파일은 여기에 있습니다 :
import android.support.v7.app.ActionBarActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.MediaController;
import android.widget.VideoView;
public class Main extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_main);
Button button = (Button) findViewById(R.id.button1);
button.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
String video_path = "http://tune.pk/player/embed_player.php?vid=4240467";
Uri uri = Uri.parse(video_path);
uri = Uri.parse("vnd.youtube:" + uri.getQueryParameter("v"));
Intent intent = new Intent(Intent.ACTION_VIEW , uri);
startActivity(intent);
}
});
}
}
매니페스트 파일이 ..입니다
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.solutionproviders.videotest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.solutionproviders.videotest.Main"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
내가 만드는 중이라서 어떤 실수 알려주세요.
오른쪽, 즉 . 어느 이 코드를 변경하고 동영상을 재생할 수있는 방법은 무엇입니까? –
@SikanderEjaz가 업데이트되었지만 여러 가지 질문을하지 마십시오 .-) DailyMotion에서 스트리밍하려면 첫 번째 링크를 따르십시오. – Simas