Try this to read a stream and display it to the console for testing.
const body = {'name': 'camera.getLivePreview'}
const response = await fetch('http://192.168.1.1/osc/commands/execute',
{method: 'POST',
body: JSON.stringify(body),
headers: {'Content-Type': 'application/json'}
});
const data = response.body
const reader = data.getReader()
while (true) {
const {value, done} = await reader.read();
if (done) break;
console.log('Received', value);
}
console.log(data);
fake-theta no camera version
const body = {'name': 'camera.getLivePreview'}
const response = await fetch('https://fake-theta.vercel.app/osc/commands/execute',
{method: 'POST',
body: JSON.stringify(body),
headers: {'Content-Type': 'application/json'}
});
const data = response.body
const reader = data.getReader()
while (true) {
const {value, done} = await reader.read();
if (done) break;
console.log('Received', value);
}
console.log(data);
expected output
Tested with RICOH THETA X.
Received Uint8Array(13140) [
154, 66, 105, 9, 166, 147, 64, 10, 90, 155, 145, 77,
38, 144, 154, 0, 121, 106, 137, 159, 61, 41, 174, 212,
176, 198, 100, 97, 143, 186, 40, 2, 72, 163, 50, 31,
106, 191, 12, 33, 71, 2, 146, 24, 192, 2, 173, 34,
208, 0, 171, 82, 129, 72, 5, 60, 80, 32, 2, 156,
41, 5, 45, 48, 22, 138, 40, 160, 5, 162, 138, 40,
1, 104, 164, 165, 160, 2, 138, 40, 160, 5, 162, 146,
150, 128, 10, 40, 162, 128, 22, 138, 74, 90, 0, 41,
105, 41, 104, 0,
... 13040 more items
]
Received Uint8Array(12525) [
120, 181, 98, 49, 36, 150, 249, 104, 219, 0, 118, 237,
86, 173, 245, 72, 159, 11, 48, 242, 143, 169, 233, 85,
102, 251, 141, 244, 53, 156, 188, 163, 231, 168, 197, 84,
100, 209, 50, 138, 102, 165, 222, 179, 28, 74, 198, 37,
46, 71, 115, 210, 185, 251, 173, 74, 238, 231, 115, 73,
39, 238, 201, 35, 104, 192, 31, 79, 122, 146, 114, 2,
50, 142, 73, 24, 2, 179, 87, 12, 141, 146, 114, 62,
232, 237, 90, 39, 115, 54, 172, 105, 198, 75, 0, 73,
201, 245, 173, 72,
... 12425 more items
]
viewing stream as images
I have not tested the code below, but reading through it, the primary algorithms look like it could be used on the stream.
Advice on React Native Expo Courses?
As I don’t know React Native, I am thinking of taking an online course.
I found these two:
I’m more interested in the Meta course on Coursera as it has a higher rating. I’ve already watched a few of the videos and it looks good.
Are you taking an online course for React Native expo?