Closed francescogatto closed 6 months ago
Hello,
The best way seem to be lock activity in landscape for smartglasses and set rotation to 0 in the library. To lock screen you can do something similar to this in onCreate:
if (smartglasses()) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
Hi!
I have some problem with orientation. I'm using your library in a SmartGlasses that supports only landscape resolution. I can see the video local correctly, but when i send it to the rtmp server, it is always in portrait and stretched. Here my code:
` override fun surfaceChanged(surfaceHolder: SurfaceHolder, i: Int, i1: Int, i2: Int) { rtmpCamera2.startPreview(1280 ,720 ) Handler().postDelayed({startStream()}, 200)
fun startStream() { if (!rtmpCamera2.isStreaming) { if (rtmpCamera2.isRecording || rtmpCamera2.prepareAudio() && rtmpCamera2.prepareVideo(1280 ,720 , 27,5000 * 1024,90 )) { rtmpCamera2.startStream(etUrl) } else { Toast.makeText( this, "Error preparing stream, This device cant do it", Toast.LENGTH_SHORT ).show() } } }
<com.pedro.rtplibrary.view.OpenGlView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/surfaceView" app:keepAspectRatio="false" app:aspectRatioMode="fill" app:AAEnabled="false" app:numFilters="1" app:isFlipHorizontal="false" app:isFlipVertical="false" />
Thanks a lot for the support, you are doing a nice work with this library