diff options
Diffstat (limited to 'indra/newview/llviewermedia.cpp')
-rw-r--r-- | indra/newview/llviewermedia.cpp | 79 |
1 files changed, 38 insertions, 41 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 3a7c54479b..e55523c11e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -278,7 +278,7 @@ viewer_media_t LLViewerMedia::newMediaImpl( } else { - media_impl->stop(); + media_impl->unload(); media_impl->mTextureId = texture_id; media_impl->mMediaWidth = media_width; media_impl->mMediaHeight = media_height; @@ -1092,15 +1092,7 @@ void LLViewerMediaImpl::stop() { if(mMediaSource) { - if(mMediaSource->pluginSupportsMediaBrowser()) - { - mMediaSource->browse_stop(); - } - else - { - mMediaSource->stop(); - } - + mMediaSource->stop(); // destroyMediaSource(); } } @@ -1133,6 +1125,40 @@ void LLViewerMediaImpl::seek(F32 time) } ////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::skipBack(F32 step_scale) +{ + if(mMediaSource) + { + if(mMediaSource->pluginSupportsMediaTime()) + { + F64 back_step = mMediaSource->getCurrentTime() - (mMediaSource->getDuration()*step_scale); + if(back_step < 0.0) + { + back_step = 0.0; + } + mMediaSource->seek(back_step); + } + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::skipForward(F32 step_scale) +{ + if(mMediaSource) + { + if(mMediaSource->pluginSupportsMediaTime()) + { + F64 forward_step = mMediaSource->getCurrentTime() + (mMediaSource->getDuration()*step_scale); + if(forward_step > mMediaSource->getDuration()) + { + forward_step = mMediaSource->getDuration(); + } + mMediaSource->seek(forward_step); + } + } +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::setVolume(F32 volume) { mRequestedVolume = volume; @@ -1339,21 +1365,7 @@ void LLViewerMediaImpl::navigateBack() { if (mMediaSource) { - if(mMediaSource->pluginSupportsMediaTime()) - { - F64 step_scale = 0.02; // temp , can be changed - F64 back_step = mMediaSource->getCurrentTime() - (mMediaSource->getDuration()*step_scale); - if(back_step < 0.0) - { - back_step = 0.0; - } - mMediaSource->seek(back_step); - //mMediaSource->start(-2.0); - } - else - { - mMediaSource->browse_back(); - } + mMediaSource->browse_back(); } } @@ -1362,21 +1374,7 @@ void LLViewerMediaImpl::navigateForward() { if (mMediaSource) { - if(mMediaSource->pluginSupportsMediaTime()) - { - F64 step_scale = 0.02; // temp , can be changed - F64 forward_step = mMediaSource->getCurrentTime() + (mMediaSource->getDuration()*step_scale); - if(forward_step > mMediaSource->getDuration()) - { - forward_step = mMediaSource->getDuration(); - } - mMediaSource->seek(forward_step); - //mMediaSource->start(2.0); - } - else - { - mMediaSource->browse_forward(); - } + mMediaSource->browse_forward(); } } @@ -1525,7 +1523,6 @@ void LLViewerMediaImpl::navigateStop() { mMediaSource->browse_stop(); } - } ////////////////////////////////////////////////////////////////////////////////////////// |