我想在android中从服务器播放mp4视频。 Video URL
我尝试使用视频视图,但出现了空白屏幕。 我也尝试使用Intent.Action视图,但它显示消息“无法播放视频”。
还有其他办法吗?
提前致谢。
答案 0 :(得分:0)
使用像这样:
String LINK = "type_here_the_link";
VideoView mVideoView = (VideoView) findViewById(R.id.videoview);
MediaController mc = new MediaController(this);
mc.setAnchorView(videoView);
mc.setMediaPlayer(videoView);
Uri video = Uri.parse(LINK);
mVideoView.setMediaController(mc);
mVideoView.setVideoURI(video);
mVideoView.start();
另一种方法:
declare @t table(ID int,ParentID int,[Status] varchar(50))
insert @t values
(1,101,'Pending')
,(2,101,'Complete')
,(3,101,'Complete')
,(4,102,'Complete')
declare @id int=2
select *
from @t A
inner join
@t B on a.ParentID=b.ParentID
where b.id=@id
and a.Status='Pending'
--OR
;With CTE as
(
select id,parentid,[Status],1 rn from @t where id=@id
union all
select a.id,a.ParentID,a.[Status],
rn+1
from @t A
inner join cte b
on a.ParentID=b.ParentID
where a.id<>@id
and a.[Status]='Pending'
and b.rn<2
)
select * from cte
where rn>1