Fix camera freezing on orientation change

Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
camera2
Leo Ma 9 years ago
parent a50396c567
commit 3e0874b080

@ -25,6 +25,6 @@ android {
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:appcompat-v7:25.1.0'
compile project(path: ':library') compile project(path: ':library')
} }

@ -243,6 +243,7 @@ public class MainActivity extends AppCompatActivity implements RtmpHandler.RtmpL
btnRecord.setText("record"); btnRecord.setText("record");
mPublisher.setScreenOrientation(newConfig.orientation); mPublisher.setScreenOrientation(newConfig.orientation);
if (btnPublish.getText().toString().contentEquals("stop")) { if (btnPublish.getText().toString().contentEquals("stop")) {
mPublisher.startCamera();
mPublisher.startEncode(); mPublisher.startEncode();
} }
} }

@ -28,6 +28,6 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
compile 'com.android.support:appcompat-v7:25.0.1' compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

Loading…
Cancel
Save