-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Drawing HTML on top of a UIView is possible #38
Comments
The aim of the cordova-plugin-iosrtc is to provide the WebRTC API without requiring custom stuff. If the video element is placed behind the Cordova HTML Said that, I may add an option to set this behavior per |
Yes, sure. |
Users can still set a desired background. Here's how the gmaps plugin solves the issue:
That's great news then. Might be worth exploring more in depth this option...
Not really, you know better than anyone what solution would fit better in your project and I just know the basic internals of the gmaps plugin. As a user I think that gmaps makes a great job providing a dummy transparent layer where you can draw freely any HTML element. That'd be undoubtedly the best solution since the users could draw a proper UI on top of the vid elements... In any case I'm going to continue researching about this issue. I'll get back to you if I find anything worth looking at or if I have any interesting idea... |
How about? z-index: -1; |
Using "z-index: -1" is what I consider a non appropriate usage of the CSS property. This is, setting "z-index: -1" may have very different results when in a web browser with native WebRTC support and when in an iOS Cordova device. I would prefer having a custom <video data-iosrtc-rear="true" autoplay></video> Thoughts? |
We are already using the z-index in a non-appropriate way to place the videos relative to other videos, so " may have very different results when in a web browser with native WebRTC" is already happening. |
Also, that way we ensure that the app has to put a transparent background in order the video to be seen.. ;) |
The issue targeting CSS to only iOS (or web or Android) has several solutions. Ionic uses classes like…
and also allows you to use dynamic targeted CSS using platform and ng-class (this is for angular but can be done with vanilla js). The main issue here is abstracting everything and letting the users easily draw custom controls. I think this could be a very valuable differentiation feature for iosrtc. I’ve thought that an interesting option could be providing default CSS controls with the plugin (like the HTML5 video tag does) and allow the users to enable/customise them via a JSON object and overriding CSS properties… something like
Then provide default CSS classes (.stopCallButton, .startCallButton, .fullScreen, .fullScreenButton, etc) for both iOS and Android (xwalk): SCSS example:
The defaults could result in a badass UI like: This way the users would have a straightforward out-of-the-box solution to use controls on top of the video, and also a starting point with simple logic in case they want to go further customising their UI’s. Just an idea... |
There are no start/stop/hold/fullscreen "buttons" in the WebRTC spec, and there shouldn't be. That assumes "softphone vision" and WebRTC is beyond that. I agree that rear video Regarding the usage of CSS classes to tell the plugin whether to put the video |
Said that, I will implement the feature this morning XD |
Yeah I know, I was just trying to get around the UI problem and the question of placing HTML on top. My suggestion was just an idea for convenience.
Fair enough... 😁 |
Hi, first thanks for the wonderful work @ibc (and eface2face for supporting it), where's the BUY_ME_BEER.md in the repo? ;) To shime on this issue (if I may):
Gload to see someone did actually nail this project for a change :) |
I didn't know about the demo app!... I guess that would be definitely a better option for the reference client with controls that I was suggesting. |
Guys, I tried yesterday with zero success. Don't know why but I was not be able to place the video I will try it again next week. |
No worries. Are you trying to replicate the gmaps technique stacking the subviews programatically or are you trying to come up with a custom solution? |
Let's say I must expend more time looking into phonegap-googlemaps-plugin... |
This would be super useful. Right now I've had to manually hide the video view when using the phonertc plugin whenever I wanted to render anything over the video. |
It would be really useful, but my time is limited. PR are welcome. |
@ibc I could try to help on that issue. This is one of the few issues I have to fix before using your project. Did you actually create a branch and started working on it? Thanks |
I started working on it with no success. I will upload a branch on Monday and notify it here. |
I've upload a new branch "rear-video" to implement this feature. For now it has the same content as master since nothing that I tried did work so I've removed it (it was useless). Notes and problems I remember:
Hope somebody can help on this :) |
This is the last outstanding issue preventing us from being able to use this in production. If you need anything at all, I'm down to help. |
How to help is explained in my previous comment. |
Hi IBC, in previous projects, we implemented an RTMP (flash) Video component for iOS as a native video component (without Cordova though), which runs in the background of a WebView component. We want to move away from flash now by using WebRTC for future projects. I don't know if I can help you with this, but all we had to do in our project was this:
In the HTML, i used
If you knew this already, sorry for bothering you ;) I just came along this thread and thought this could help |
@ibc Did you ever get the chance to look into derMani's workaround? |
Not yet, sorry. |
Maybe this can work: Include a local HTTP server in the webRTC plugin to serve the video content to the video tag - this can hopefully allow both overlayed HTML elements along with full CSS styling control. We used this technique when we created an RTMP plugin... |
This is in the works, so far the video successfully playing the background (HTML body must have transparent background), |
Sweet! I'd like to test it. Currently, my work around is to launch a wizviewmanager child window over the main view - so basically the webrtc video is "sandwiched" in-between. You have to use the window messaging to allow button interaction from wizview back to your main view. |
@acylum awesome thanks! just replied you :) |
+1 |
+1 are good, but pull requests are even better :) |
@ibc I have this working in my fork, see my last commit here: https://github.com/1N50MN14/cordova-plugin-iosrtc/commit/30ccdaa583b1f33f790bb8db3a5789fcdd8088e4 I'm not able to send a PR just yet, but feel free to take it for a spin in the meantime |
Great! Let me handle that on next week. |
Take your time |
Hey guys, just wanted to know if you have an update on this. |
@derMani I submitted a PR for this one, waiting for ibc to look into it and eventually approve it, otherwise you can use my fork for now. |
Guys, I won't be able to merge the PR until the second week of the new year. |
@ibc No worries, Merry Christmas! ;) |
Same! :) |
Happy new year everyone! @1N50MN14 your PR works superb 👍 Thx :) |
@derMani Du bist willkommen und Frohes Neues Jahr :) |
@telemakhos Yup I can make that work once @saghul submits his PR for WKWebView support |
Hi, I'm sorry I couldn't properly check the status of the PR #98. I commented some issues regarding the PR (for example: So, if somebody can spend time to test #98 and provide proper conclusions I will merge it. |
Sorry to bother you again @ibc, but are there any news regarding this issue? |
Not directly related to this repo, but a plugin I work on just released support for rendering the camera preview layer behind a transparent UIWebView or WKWebView: bitpay/cordova-plugin-qrscanner It's just a simple plugin, but might help if someone is trying to implement the same thing here: https://github.com/bitpay/cordova-plugin-qrscanner/blob/master/src/ios/QRScanner.swift |
I think the status regarding this PR is already explained in comments above, but I'll try to summarize here:
So, if someone wants to contribute, take this PR, apply it into a fork of the official |
Just upgraded to 3.0.0 of the Plugin and the PR still works for me. The steps are basically the same as before (and suggested in the PR)
I think I could provide a small example project, if you wish. @ibc What exactly are "all use cases" ? :-) I just created a web page, made sure everything had the correct CSS and after that I was able to see the video through my transparent elements. Maybe that's the problem for some people here, you have to make everything transparent on your page, if you want to look through it. It's easy to forget about a few elements, which might still have a background-color (like body, html, ...) |
Actually is not working for me. Using 3.0.0; Having all transparant. (verified several times). body { [nav-view-transition="ios"][nav-view-direction="forward"], [nav-view-transition="ios"][nav-view-direction="back"] { #myMiniVideo {
} #videoscreen .video_controls {
} Video overlays the .video_controls... :( Changes in PluginMediaStreamRenderer.swift :
|
I mean how it works. Which values do To be clear: I don't have an iOS device so I won't check all the cases, that's why I need complete documentation regarding how this PR works. BTW as you can see, a comment after your says that it fails. If I accept this PR as it is, I'll become responsible of such a problem. |
Done in #179 |
Is there anyway to redraw the rendering video onto a HTML5 canvas? |
Is it possible to hide the video tag from view? This way I imagine it would be possible to show the video in canvas while the original video is playing in the background, hidden from the viewport |
Is this really accurate?
Not sure if it'll work with a video layer, but for the Google Maps phonegap plugin drawing HTML on top of a native UIView is not a problem. Actually it works wonders...
Here's the trick.
So just passing by and putting this on your radar guys.
Hope it helps!
The text was updated successfully, but these errors were encountered: