-
Notifications
You must be signed in to change notification settings - Fork 594
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
Can the hs.webview display local videos? #1421
Comments
You could try this? |
It works but the display feels laggy, and It eats a lot of CPU, maybe Hammerspoon is not good at this kind of task.:) |
I experimented with a module for the AVPlayerView object a while back as an additional type for a canvas... trying to tie the two together I ran into a number of issues that would require a complete rethinking of how Hammerspoon handles view objects, so I kind of put it on hold. However, if there is interest, I think I could have an independent AVPlayerView module available in a few days... it wouldn't integrate with canvas and would be in its own window (though like webview, I'd add methods to choose the window decorations, resizability, etc.) |
@asmagill Thanks for the quick response :) |
No clue... Does that seem to make a difference when you play it through Safari? (or another web browser, but Safari is probably going to be the closest comparison to the WKWebView object we use since they're both provided by Apple and both WebKit based) A completely off-the-top-of-my-head-no-real-evidence-to-support-it theory might be that turning audio off changes the playback buffer cache size and since Hammerspoon does 90%+ of its work on the main thread in the main queue the new cache isn't big enough... but this doesn't get us any closer to a fix since WKWebview doesn't allow us to modify cache sizes and if it's a plugin handling the playback, we have even less control, so... I'm going to see if I can resurrect my avplayer module this weekend and maybe we can see if it fairs any better. |
Works fine in Safari. |
If you want to take a look at an avplayer module, check out https://github.com/asmagill/hammerspoon_asm/tree/master/avplayer I've not had the chance to test it beyond loading a local file and playing it, so if you do use it, please let me know if you run into anything that doesn't work as expected. |
Well I just want to make something like a dynamic wallpaper and I tried to use hs.webview, these html can play local videos in Safari
but in hs,webview the video didn't show up. Is there any way to do this?
The text was updated successfully, but these errors were encountered: