RICOH SDK theta-client Updated with Improved Android live preview for SC2

New commit from simago Fix the issue where live preview sometimes does not start.

image

Documentation for theta-client for Android in English.

theta-client/tutorial-android.md at main · ricohapi/theta-client · GitHub

My Tests

equipment

  • Google Pixel 2 running Android 11 - physical device
  • RICOH THETA SC2 running 1.71
  • built on Windows 11 with Android Studio Electric Eel

process

  • installed apk on physical device
  • took 12 shots in sequence

results

  • in my office with many, many other hotspots, the connection was stable when I put the camera very close to the Pixel 2.
  • preview stable, but locked in a cropped view
  • transfer stable (though it did take about 10 to 20 seconds including the stitching time)
  • postview stable with good 360 navigation
  • moving camera away from phone resulted in inconsistent response (my office has extensive wifi interference)

Hi can you please let me know the steps for live preview
I used getLivepreview method but it throws can’t start preview clients

@Dhivya_Balaji please advise if you are using theta-client or if you are using the API alone for camera.getLivePreview

There are many examples of using the API alone in this forum. There are also demos of theta-client for Android native, iOS native, Flutter (Android and iOS), and React Native (Android and iOS)

https://github.com/ricohapi/theta-client/blob/main/demos/demo-android/app/src/main/java/com/ricoh360/thetaclient/thetaClientDemo/PreviewScreen.kt

There is also documentation in the docs folder of theta-client

https://github.com/ricohapi/theta-client/blob/main/docs/tutorial-android.md#preview

import io.ktor.utils.io.core.ByteReadPacket

thetaRepository.getLivePreview()
	.collect { byteReadPacket ->
		if (isActive) {
			byteReadPacket.inputStream().use {
				// Displaying the stream as JPEG
			}
		}
		byteReadPacket.release()
	}

I am using thetaclient with 1.6.0 version
I have downloaded demo app for Android
But getLivepreview is not worked it throws
Preview Clients Error : Permanent redirect

If possible share code for me to get livepreview i am testing with simulator api that is fake.theta.vercel.app

I’m not sure if getLivePreview will work with fake-theta and theta-client. fake-theta will only return a single image. I haven’t tested fake-theta recently and haven’t used the preview with theta-client.

Likely the best way to get help is the GitHub issue of theta-client.

Preview Client Issue · Issue #58 · ricohapi/theta-client · GitHub

From GitHub

You use fake theta. Its protocol is https but theta client preview function does not support https.