Closed Alexxiaopang closed 2 years ago
可以的 `
String sourceUrl = mMaxMediaData.getSourceUrl();
if (mMaxMediaData.isLocalMediaData()) {
sourceUrl = mMaxMediaData.getLocalVideoPath();
}
final MediaInfo mediaInfo = new MediaInfo();
if (mMaxMediaData.isLocalMediaData()) {
mediaInfo.setFilePath(sourceUrl);
}
mediaInfo.setMediaId(EncryptUtils.encryptMD5ToString(sourceUrl));
mediaInfo.setMediaType(MediaInfo.TYPE_VIDEO);
mediaInfo.setMediaName(mMaxMediaData.getTitle());
mediaInfo.setUri(sourceUrl);
mDLNAPlayer.setDataSource(mediaInfo);
mDLNAPlayer.start(new DLNAControlCallback() {
@Override
public void onSuccess(@Nullable ActionInvocation invocation) {
ToastUtils.showShort("投屏成功!");
getContentView().post(new Runnable() {
@Override
public void run() {
dismiss();
}
});
}
@Override
public void onReceived(@Nullable ActionInvocation invocation, @Nullable Object... extra) {
}
@Override
public void onFailure(@Nullable ActionInvocation invocation, int errorCode, @Nullable String errorMsg) {
ToastUtils.showShort("投屏失败!");
}
});
`
如题,能否播放网络地址?