Commit fd2149c2e00fa8461ea5e981a1bfbc501f75f3c3
1 parent
fd2b1ae2
更新jar 添加标注
Showing
3 changed files
with
37 additions
and
48 deletions
app/libs/libcnlivestream.jar
No preview for this file type
app/libs/libcnliveutil.jar
No preview for this file type
app/src/main/java/com/cnlive/demo/stream/StreamActivity.java
| ... | ... | @@ -522,91 +522,85 @@ public class StreamActivity extends Activity { |
| 522 | 522 | private IStreamer.OnErrorListener mOnErrorListener = new IStreamer.OnErrorListener() { |
| 523 | 523 | @Override |
| 524 | 524 | public void onError(int what, int msg1, int msg2) { |
| 525 | - Log.e("demoview", " " + what); | |
| 525 | + | |
| 526 | + if (what < 0) { | |
| 527 | + mRecording = false; | |
| 528 | + mShootingText.setText(START_STRING); | |
| 529 | + mShootingText.postInvalidate(); | |
| 530 | + } | |
| 531 | + | |
| 526 | 532 | switch (what) { |
| 533 | + case IStreamer.cnstream_error_start_stream_server: | |
| 534 | + //开始直播时请求服务器失败 | |
| 535 | + break; | |
| 536 | + case IStreamer.cnstream_error_start_stream_network: | |
| 537 | + //开始直播时网络连接失败 | |
| 538 | + break; | |
| 539 | + case IStreamer.cnstream_error_start_stream_other: | |
| 540 | + //开始直播活动失败 | |
| 541 | + break; | |
| 542 | + case IStreamer.cnstream_error_create_stream_server: | |
| 543 | + //创建直播活动请求服务器失败 | |
| 544 | + break; | |
| 545 | + case IStreamer.cnstream_error_create_stream_network: | |
| 546 | + //创建直播活动时网络连接失败 | |
| 547 | + break; | |
| 548 | + case IStreamer.cnstream_error_create_stream_other: | |
| 549 | + //创建直播活动时失败 | |
| 550 | + break; | |
| 551 | + case IStreamer.cnstream_record_error: | |
| 552 | + //直播录制失败 | |
| 553 | + break; | |
| 554 | + case IStreamer.cnstream_error_stop_stream: | |
| 555 | + //停止直播活动失败 | |
| 556 | + break; | |
| 557 | + case IStreamer.cnstream_socket_disconnect: | |
| 558 | + //推流Socket异常断开 | |
| 559 | + break; | |
| 560 | + case IStreamer.cnstream_init_error_instop: | |
| 561 | + //初始化失败 正在停止推流 | |
| 562 | + break; | |
| 527 | 563 | case IStreamer.cnstream_error_dns_parse_failed: |
| 528 | 564 | Log.d(TAG, "cnstream_error_dns_parse_failed"); |
| 529 | - mRecording = false; | |
| 530 | - mShootingText.setText(START_STRING); | |
| 531 | - mShootingText.postInvalidate(); | |
| 532 | 565 | break; |
| 533 | 566 | case IStreamer.cnstream_error_connect_failed: |
| 534 | 567 | Log.d(TAG, "cnstream_error_connect_failed"); |
| 535 | - mRecording = false; | |
| 536 | - mShootingText.setText(START_STRING); | |
| 537 | - mShootingText.postInvalidate(); | |
| 538 | 568 | break; |
| 539 | 569 | case IStreamer.cnstream_error_publish_failed: |
| 540 | 570 | Log.d(TAG, "cnstream_error_publish_failed"); |
| 541 | - mRecording = false; | |
| 542 | - mShootingText.setText(START_STRING); | |
| 543 | - mShootingText.postInvalidate(); | |
| 544 | 571 | break; |
| 545 | 572 | case IStreamer.cnstream_error_connect_breaked: |
| 546 | 573 | Log.d(TAG, "cnstream_error_connect_breaked"); |
| 547 | - mRecording = false; | |
| 548 | - mShootingText.setText(START_STRING); | |
| 549 | - mShootingText.postInvalidate(); | |
| 550 | 574 | break; |
| 551 | 575 | case IStreamer.cnstream_error_av_async: |
| 552 | 576 | Log.d(TAG, "cnstream_error_av_async " + msg1 + " ms"); |
| 553 | - mRecording = false; | |
| 554 | - mShootingText.setText(START_STRING); | |
| 555 | - mShootingText.postInvalidate(); | |
| 556 | 577 | break; |
| 557 | 578 | case IStreamer.cnstream_video_encoder_error_unsupported: |
| 558 | 579 | Log.d(TAG, "cnstream_video_encoder_error_unsupported"); |
| 559 | - mRecording = false; | |
| 560 | - mShootingText.setText(START_STRING); | |
| 561 | - mShootingText.postInvalidate(); | |
| 562 | 580 | break; |
| 563 | 581 | case IStreamer.cnstream_video_encoder_error_unknown: |
| 564 | 582 | Log.d(TAG, "cnstream_video_encoder_error_unknown"); |
| 565 | - mRecording = false; | |
| 566 | - mShootingText.setText(START_STRING); | |
| 567 | - mShootingText.postInvalidate(); | |
| 568 | 583 | break; |
| 569 | 584 | case IStreamer.cnstream_audio_encoder_error_unsupported: |
| 570 | 585 | Log.d(TAG, "cnstream_audio_encoder_error_unsupported"); |
| 571 | - mRecording = false; | |
| 572 | - mShootingText.setText(START_STRING); | |
| 573 | - mShootingText.postInvalidate(); | |
| 574 | 586 | break; |
| 575 | 587 | case IStreamer.cnstream_audio_encoder_error_unknown: |
| 576 | 588 | Log.d(TAG, "cnstream_audio_encoder_error_unknown"); |
| 577 | - mRecording = false; | |
| 578 | - mShootingText.setText(START_STRING); | |
| 579 | - mShootingText.postInvalidate(); | |
| 580 | 589 | break; |
| 581 | 590 | case IStreamer.cnstream_audio_recorder_error_start_failed: |
| 582 | 591 | Log.d(TAG, "cnstream_audio_recorder_error_start_failed"); |
| 583 | - mRecording = false; | |
| 584 | - mShootingText.setText(START_STRING); | |
| 585 | - mShootingText.postInvalidate(); | |
| 586 | 592 | break; |
| 587 | 593 | case IStreamer.cnstream_audio_recorder_error_unknown: |
| 588 | 594 | Log.d(TAG, "cnstream_audio_recorder_error_unknown"); |
| 589 | - mRecording = false; | |
| 590 | - mShootingText.setText(START_STRING); | |
| 591 | - mShootingText.postInvalidate(); | |
| 592 | 595 | break; |
| 593 | 596 | case IStreamer.cnstream_camera_error_unknown: |
| 594 | 597 | Log.d(TAG, "cnstream_camera_error_unknown"); |
| 595 | - mRecording = false; | |
| 596 | - mShootingText.setText(START_STRING); | |
| 597 | - mShootingText.postInvalidate(); | |
| 598 | 598 | break; |
| 599 | 599 | case IStreamer.cnstream_camera_error_start_failed: |
| 600 | 600 | Log.d(TAG, "cnstream_camera_error_start_failed"); |
| 601 | - mRecording = false; | |
| 602 | - mShootingText.setText(START_STRING); | |
| 603 | - mShootingText.postInvalidate(); | |
| 604 | 601 | break; |
| 605 | 602 | case IStreamer.cnstream_camera_error_server_died: |
| 606 | 603 | Log.d(TAG, "cnstream_camera_error_server_died"); |
| 607 | - mRecording = false; | |
| 608 | - mShootingText.setText(START_STRING); | |
| 609 | - mShootingText.postInvalidate(); | |
| 610 | 604 | break; |
| 611 | 605 | default: |
| 612 | 606 | Log.d(TAG, "what= " + what + " msg1= " + msg1 + " msg2= " + msg2); |
| ... | ... | @@ -692,10 +686,5 @@ public class StreamActivity extends Activity { |
| 692 | 686 | public String getCallbackAcitvityStatushttpPostUrl() { |
| 693 | 687 | return ""; |
| 694 | 688 | } |
| 695 | - | |
| 696 | - @Override | |
| 697 | - public String getRemark() { | |
| 698 | - return ""; | |
| 699 | - } | |
| 700 | 689 | }; |
| 701 | 690 | } | ... | ... |