| 548 | } |
| 549 | |
| 550 | void MediaPlayer::SetLoop(bool bLoop) |
| 551 | { |
| 552 | mLoop = bLoop; |
| 553 | |
| 554 | if (mCollector) { |
| 555 | mCollector->ReportLooping(bLoop); |
| 556 | } |
| 557 | |
| 558 | GET_PLAYER_HANDLE |
| 559 | CicadaSetLoop(handle, bLoop); |
| 560 | #ifdef ENABLE_CACHE_MODULE |
| 561 | //if cache successed before setLoop. |
| 562 | if (mCacheManager != nullptr) { |
| 563 | if (mCacheSuccess && IsLoop()) { |
| 564 | //if cache success and want play loop, |
| 565 | // we set loop false to let onCompletion callback deal loop. |
| 566 | CicadaSetLoop(handle, false); |
| 567 | } |
| 568 | } |
| 569 | #endif |
| 570 | } |
| 571 | |
| 572 | bool MediaPlayer::IsLoop() |
| 573 | { |