Reply To: How to build a wbsite with mxtv player

About XMTV Player Forums Development How to build a wbsite with mxtv player Reply To: How to build a wbsite with mxtv player

#630

support
Keymaster

If you use WewView to show you mobile page, you can handle urls and make check

http://developer.android.com/reference/android/webkit/WebViewClient.html#shouldOverrideUrlLoading%28android.webkit.WebView,%20java.lang.String%29

some samples you can see at http://xmtvplayer.com/development-api

webView.setWebViewClient(new WebViewClient(){
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
// make ckeck if url is VideoLink
// check is XMTVPlyaer is Installed on User device using isXMTVPlayerAvailable code
// Call XMTVPlayer Intent using XMTVPlayerPlayUri code
}
});

public static boolean isXMTVPlayerAvailable(Context context) {
PackageManager pm = context.getPackageManager();
boolean app_installed = false;
try {
pm.getPackageInfo(“com.xmtvplayer.watch.live.streams”, PackageManager.GET_ACTIVITIES);
app_installed = true;
}
catch (PackageManager.NameNotFoundException e) {
app_installed = false;
}
return app_installed ;
}

/**
* @param Title – Media Name
* @param uri – path/url to media
*/
public void XMTVPlayerPlayUri(String Title,String uri){
Bundle bnd = new Bundle();
bnd.putString(“path”, uri);
bnd.putString(“name”, Title);
Intent intent = new Intent();
intent.setClassName(“com.xmtvplayer.watch.live.streams”,”org.zeipel.videoplayer.XMTVPlayer”);
intent.putExtras(bnd);
startActivityForResult(intent, 100);
}

IPTV | Smart TV | Mobile Theatre Software | Media Player for Android(tm)