cordova-plugin-iosrtc
cordova-plugin-iosrtc copied to clipboard
Merge Websocket to Canvas WebGL stream from PeterXu #620
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
@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
- Yes, canvas can be disable (default enable in current code).
- Ok, I will debug and tune the changing of size.
Thank you @PeterXu , how do you disable canvas ?
@hthetiot , It can be disabled by set hasCanvas to false in function MediaStreamRenderer.
Perfect, i will disable by default for now and allow to enable via config.xml
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