Video not playing
rameez-sgi opened this issue · 2 comments
rameez-sgi commented
I did exactly like in the documentary , there are no errors but player does not start and on starting media player it shows this error : E/IJKMEDIA: Failed to resolve hostname 2449.vod.myqcloud.com: No address associated with hostname
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
MxVideoPlayerWidget videoPlayerWidget = (MxVideoPlayerWidget) findViewById(R.id.mpw_video_player);
videoPlayerWidget.startPlay("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4", MxVideoPlayer.SCREEN_LAYOUT_NORMAL, "Test Video");
}
@Override
protected void onPause() {
super.onPause();
MxVideoPlayer.releaseAllVideos();
}
@Override
public void onBackPressed() {
if (MxVideoPlayer.backPress()) {
return;
}
super.onBackPressed();
}
}
henryblue commented
Do you add permissions?
<uses-permission android:name="android.permission.INTERNET" />
if you add, you can try add:
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /> <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
rameez-sgi commented
Yes !! so silly of me ! I didnt add the internet permissions !! thank you sir !! :)