How to start video streaming automatically when CameraDemoActivit is ready?
gushangzao007 opened this issue · comments
My Target: start video streaming automatically when CameraDemoActivit is ready.
What I have done: move following code to the onCreate function of CameraDemoActivit.
What is the test result?
- video surface is always black in screen
- got Error from Toast: connection faild , sps....is nulll..bla bla
could you help to advise a correct method to start streaming automatically?
Thank you very much。
there are detail error information
errorLog.txt
by the way, I'm using Timer class in onCreate function as a work around method to temporally solve it. however personally I think this is not an elegant way.
Hello,
You have that error because you need wait until the view is totally created.
The view is created when this callback is called:
That is the reason because I call start preview here and not in onCreate.
And destroyed in this one:
Thanks a lot buddy! let me try
cool! work perfect! Thanks again!