# Share Button
ByteArk Player SDK for Android supports a share button that uses the URL specified via withShareUrl(...) on ByteArkPlayerItem.
# Enable in player builder
val playerBuilder = ByteArkPlayerBuilder.Builder()
.withContext(this)
.withControl()
.withShareOption()
.build()
1
2
3
4
5
2
3
4
5
# Set the share URL
val playerItem = ByteArkPlayerItemBuilder.Builder()
.withMediaId("VIDEO_ID")
.withTitle("Big Buck Bunny")
.withUrl("https://example.com/playlist.m3u8")
.withShareUrl("https://example.com/video/VIDEO_ID")
.build()
mPlayerFragment.openMedia(playerItem)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
Note
If withShareUrl(...) is not set, the Share button falls back to the video URL (withUrl(...)), which may not be suitable for sharing.