Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a custom flashVer string #1474

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions rtmp/src/main/java/com/pedro/rtmp/rtmp/CommandsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ abstract class CommandsManager {
var appName = ""
var streamName = ""
var tcUrl = ""
var flashVer: String = "FMLE/3.0 (compatible; Lavf57.56.101)"
var user: String? = null
var password: String? = null
var onAuth = false
Expand Down Expand Up @@ -85,6 +86,10 @@ abstract class CommandsManager {
this.password = password
}

fun setFlashVer(flashVer: String) {
this.flashVer = flashVer
}

protected fun getCurrentTimestamp(): Int {
return (TimeUtils.getCurrentTimeMillis() / 1000 - timestamp).toInt()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CommandsManagerAmf0: CommandsManager() {
BasicHeader(ChunkType.TYPE_0, ChunkStreamId.OVER_CONNECTION.mark))
val connectInfo = AmfObject()
connectInfo.setProperty("app", appName + auth)
connectInfo.setProperty("flashVer", "FMLE/3.0 (compatible; Lavf57.56.101)")
connectInfo.setProperty("flashVer", flashVer)
connectInfo.setProperty("tcUrl", tcUrl + auth)
if (!videoDisabled) {
if (videoCodec == VideoCodec.H265) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CommandsManagerAmf3: CommandsManager() {
BasicHeader(ChunkType.TYPE_0, ChunkStreamId.OVER_CONNECTION.mark))
val connectInfo = Amf3Object()
connectInfo.setProperty("app", appName + auth)
connectInfo.setProperty("flashVer", "FMLE/3.0 (compatible; Lavf57.56.101)")
connectInfo.setProperty("flashVer", flashVer)
connectInfo.setProperty("tcUrl", tcUrl + auth)
if (!videoDisabled) {
if (videoCodec == VideoCodec.H265) {
Expand Down
4 changes: 4 additions & 0 deletions rtmp/src/main/java/com/pedro/rtmp/rtmp/RtmpClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ class RtmpClient(private val connectChecker: ConnectChecker) {
commandsManager.fps = fps
}

fun setFlashVer(flashVer: String) {
commandsManager.flashVer = flashVer
}

fun connect(url: String?) {
connect(url, false)
}
Expand Down