-
Notifications
You must be signed in to change notification settings - Fork 45
support harmony remote by mjpeg #39
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
support harmony remote by mjpeg #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for HarmonyOS remote screen streaming via MJPEG and integrates it into the application. Key changes include updating scrcpy server path formatting, introducing a new HTML page for video display and associated WebSocket handling, implementing the HarmonyMjpegServer class for HarmonyOS, and updating dependency management and documentation.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
uiautodev/remote/scrcpy.py | Adjusted code formatting for scrcpy server JAR path initialization |
uiautodev/remote/html/harmony-video.html | Added a new HTML page for MJPEG video stream with WebSocket logic |
uiautodev/remote/harmony_scrcpy.py | Introduced HarmonyMjpegServer for handling HarmonyOS screen streaming |
uiautodev/app.py | Added a new WebSocket endpoint and helper function for HarmonyOS |
pyproject.toml | Updated dependencies and extras for HarmonyOS support |
README.md | Updated installation instructions for the HarmonyOS extras package |
Comments suppressed due to low confidence (1)
uiautodev/remote/html/harmony-video.html:124
- The coordinate logging indicates a value of 0 for startX (and similarly for other coordinates), which may signal an issue with the coordinate calculation logic or event processing. Please verify that the calculateCoordinates() function correctly translates canvas coordinates, or remove these debug logs if they are no longer required.
console.log(startX); // 输出 0
// isMouseDown = true; | ||
downCoordinates = calculateCoordinates(event) | ||
|
||
|
||
// 按下即触发点击事件 | ||
// sendMouseEvent('normal', downCoordinates); | ||
// endX = startX; | ||
// endY = startY; | ||
|
||
// Long press detection | ||
// longPressTimer = setTimeout(function() { | ||
// if (isMouseDown) { | ||
// sendMouseEvent('long', { clientX: startX, clientY: startY }); | ||
// } | ||
// }, 500); // Long press time threshold in milliseconds | ||
}); | ||
|
||
// canvas.addEventListener('mousemove', function(event) { | ||
// console.log('move', event.clientX, event.clientY) | ||
// if (isMouseDown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider removing or cleaning up commented-out code blocks in the mouse event handlers to enhance code clarity and maintainability, particularly if they are no longer needed for debugging or future functionality.
// isMouseDown = true; | |
downCoordinates = calculateCoordinates(event) | |
// 按下即触发点击事件 | |
// sendMouseEvent('normal', downCoordinates); | |
// endX = startX; | |
// endY = startY; | |
// Long press detection | |
// longPressTimer = setTimeout(function() { | |
// if (isMouseDown) { | |
// sendMouseEvent('long', { clientX: startX, clientY: startY }); | |
// } | |
// }, 500); // Long press time threshold in milliseconds | |
}); | |
// canvas.addEventListener('mousemove', function(event) { | |
// console.log('move', event.clientX, event.clientY) | |
// if (isMouseDown) { | |
downCoordinates = calculateCoordinates(event); | |
}); | |
// Future implementation for mousemove event can be added here if needed. |
Copilot uses AI. Check for mistakes.
uiautodev/remote/harmony_scrcpy.py
Outdated
self.is_running = False | ||
|
||
def connect(self): | ||
self.channel = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider setting a timeout on the socket (e.g., using settimeout) to avoid potential blocking during long network reads in production environments.
self.channel = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.channel = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.channel.settimeout(10) # Set a timeout of 10 seconds for socket operations |
Copilot uses AI. Check for mistakes.
* support harmony remote by mjpeg * support harmony remote by mjpeg optimize server name * adjust pip install of harmony dependencies * adjust pip install of harmony dependencies fixed extras * adjust pip install of harmony dependencies fixed import * adjust pip install of harmony dependencies fixed import test setuptools * adjust pip install of harmony dependencies fixed import test setuptools lazy * do little update * update readme, move html to examples --------- Co-authored-by: codeskyblue <codeskyblue@gmail.com>
* support harmony remote by mjpeg * support harmony remote by mjpeg optimize server name * adjust pip install of harmony dependencies * adjust pip install of harmony dependencies fixed extras * adjust pip install of harmony dependencies fixed import * adjust pip install of harmony dependencies fixed import test setuptools * adjust pip install of harmony dependencies fixed import test setuptools lazy * do little update * update readme, move html to examples --------- Co-authored-by: codeskyblue <codeskyblue@gmail.com>
No description provided.