【发布时间】:2020-03-17 10:14:19
【问题描述】:
我有一个 jwplayer 帐户,并在那里上传了一些视频。
现在我想添加质量更改按钮,也想让播放器根据互联网选择视频质量。但是如何做到这一点
xml 文件:-
<com.longtailvideo.jwplayer.JWPlayerView xmlns:jwp="http://schemas.android.com/apk/lib/com.longtailvideo.jwplayer"
android:id="@+id/jwplayer"
android:layout_width="match_parent"
android:layout_height="match_parent" />
java 文件:-
mPlayerView = findViewById(R.id.jwplayer);
PlaylistItem playlistItem = new PlaylistItem.Builder()
.file("https://content.jwplatform.com/videos/k6Jle9TB-Ruucf9kn.mp4")
.image("https://image.shutterstock.com/image-photo/mountains-during-sunset-beautiful-natural-260nw-407021107.jpg")
.title("Playlist-Item Title")
.description("Some really great content")
.build();
RelatedConfig related = new RelatedConfig.Builder()
.file("https://content.jwplatform.com/videos/IHToMSjV-Ruucf9kn.mp4")
.autoPlayTimer(5)
.onComplete(RELATED_ON_COMPLETE_AUTOPLAY)
.autoPlayMessage("new video will begin in 10 seconds")
.build();
List<PlaylistItem> playlist = new ArrayList<>();
playlist.add(playlistItem);
PlayerConfig config = new PlayerConfig.Builder()
.playlist(playlist)
.relatedConfig(related)
.build();
mPlayerView.setup(config);
我还想直播视频所以我想出了 DASH,它没有关于 jwplayer 文档的文档。 所以从哪里开始请指导我。
【问题讨论】: