cordova-plugin-iosrtc icon indicating copy to clipboard operation
cordova-plugin-iosrtc copied to clipboard

Merge Websocket to Canvas WebGL stream from PeterXu #620

Open hthetiot opened this issue 3 years ago • 6 comments

Testing

To test PeterXu/master branch

cordova plugin remove cordova-plugin-iosrtc --verbose
cordova plugin add https://github.com/cordova-rtc/cordova-plugin-iosrtc#PeterXu/master --verbose
cordova platform remove ios --no-save
cordova platform add ios --no-save

hthetiot avatar Jan 05 '21 12:01 hthetiot

@PeterXu , I tested it and it works well, i added a fix to handle video tag without id.

Quick questions:

  • Can canvas render be disable, im not sure it should be default rendering yet.
  • I noticed the the canvas does not always attaptto the video tag position and size, can you handle that part also?

hthetiot avatar Jan 25 '21 10:01 hthetiot

@hthetiot

  • Yes, canvas can be disable (default enable in current code).
  • Ok, I will debug and tune the changing of size.

PeterXu avatar Jan 26 '21 09:01 PeterXu

Thank you @PeterXu , how do you disable canvas ?

hthetiot avatar Jan 26 '21 11:01 hthetiot

@hthetiot , It can be disabled by set hasCanvas to false in function MediaStreamRenderer.

diff.log

PeterXu avatar Jan 27 '21 09:01 PeterXu

@hthetiot , It can be disabled by set hasCanvas to false in function MediaStreamRenderer.

diff.log

Perfect, i will disable by default for now and allow to enable via config.xml

hthetiot avatar Jan 27 '21 12:01 hthetiot

Current build fail due following errors:

/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:60:8: error: value of optional type 'UIView?' must be unwrapped to refer to member 'backgroundColor' of wrapped base type 'UIView'
                self.elementView.backgroundColor = UIColor.black
                     ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:60:8: note: chain the optional using '?' to access member 'backgroundColor' only for non-'nil' base values
                self.elementView.backgroundColor = UIColor.black
                     ^
                                ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:60:8: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                self.elementView.backgroundColor = UIColor.black
                     ^
                                !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:8: error: value of optional type 'UIView?' must be unwrapped to refer to member 'addSubview' of wrapped base type 'UIView'
                self.elementView.addSubview(self.videoView)
                     ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:8: note: chain the optional using '?' to access member 'addSubview' only for non-'nil' base values
                self.elementView.addSubview(self.videoView)
                     ^
                                ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:8: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                self.elementView.addSubview(self.videoView)
                     ^
                                !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:36: error: value of optional type 'RTCEAGLVideoView?' must be unwrapped to a value of type 'RTCEAGLVideoView'
                self.elementView.addSubview(self.videoView)
                                                 ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:36: note: coalesce using '??' to provide a default when the optional value contains 'nil'
                self.elementView.addSubview(self.videoView)
                                                 ^
                                                           ?? <#default value#>
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:61:36: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                self.elementView.addSubview(self.videoView)
                                                 ^
                                                          !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:62:8: error: value of optional type 'UIView?' must be unwrapped to refer to member 'layer' of wrapped base type 'UIView'
                self.elementView.layer.masksToBounds = true
                     ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:62:8: note: chain the optional using '?' to access member 'layer' only for non-'nil' base values
                self.elementView.layer.masksToBounds = true
                     ^
                                ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:62:8: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                self.elementView.layer.masksToBounds = true
                     ^
                                !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:63:8: error: value of optional type 'UIView?' must be unwrapped to refer to member 'translatesAutoresizingMaskIntoConstraints' of wrapped base type 'UIView'
                self.elementView.translatesAutoresizingMaskIntoConstraints = false
                     ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:63:8: note: chain the optional using '?' to access member 'translatesAutoresizingMaskIntoConstraints' only for non-'nil' base values
                self.elementView.translatesAutoresizingMaskIntoConstraints = false
                     ^
                                ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:63:8: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                self.elementView.translatesAutoresizingMaskIntoConstraints = false
                     ^
                                !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:66:27: error: use of local variable 'view' before its declaration
                self.webView.addSubview(view)
                                        ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:74:7: note: 'view' declared here
                let view = self.elementView;
                    ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:77:5: error: value of optional type 'UIView?' must be unwrapped to refer to member 'topAnchor' of wrapped base type 'UIView'
                                view.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true
                                ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:77:5: note: chain the optional using '?' to access member 'topAnchor' only for non-'nil' base values
                                view.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true
                                ^
                                    ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:77:5: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                                view.topAnchor.constraint(equalTo: guide.topAnchor).isActive = true
                                ^
                                    !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:78:5: error: value of optional type 'UIView?' must be unwrapped to refer to member 'bottomAnchor' of wrapped base type 'UIView'
                                view.bottomAnchor.constraint(equalTo: guide.bottomAnchor).isActive = true
                                ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:78:5: note: chain the optional using '?' to access member 'bottomAnchor' only for non-'nil' base values
                                view.bottomAnchor.constraint(equalTo: guide.bottomAnchor).isActive = true
                                ^
                                    ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:78:5: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                                view.bottomAnchor.constraint(equalTo: guide.bottomAnchor).isActive = true
                                ^
                                    !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:79:5: error: value of optional type 'UIView?' must be unwrapped to refer to member 'leftAnchor' of wrapped base type 'UIView'
                                view.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true
                                ^
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:79:5: note: chain the optional using '?' to access member 'leftAnchor' only for non-'nil' base values
                                view.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true
                                ^
                                    ?
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:79:5: note: force-unwrap using '!' to abort execution if the optional value contains 'nil'
                                view.leftAnchor.constraint(equalTo: guide.leftAnchor).isActive = true
                                ^
                                    !
/Users/runner/work/cordova-plugin-iosrtc/myApp/platforms/ios/myApp/Plugins/cordova-plugin-iosrtc/PluginMediaStreamRenderer.swift:80:5: error: value of optional type 'UIView?' must be unwrapped to refer to member 'rightAnchor' of wrapped base type 'UIView'
                                view.rightAnchor.constraint(equalTo: guide.rightAnchor).isActive = true

hthetiot avatar May 12 '22 12:05 hthetiot