Skip to content

Commit

Permalink
Possible fix for #9429 (setBrowserVolume does not work)
Browse files Browse the repository at this point in the history
  • Loading branch information
jushar committed Oct 20, 2016
1 parent 457a60e commit 63fe60b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Client/cefweb/CWebView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,14 @@ bool CWebView::SetAudioVolume ( float fVolume )
"tags = document.getElementsByTagName('video'); for (var i = 0; i<tags.length; ++i) { mta_adjustAudioVol(tags[i], %f); }",
fVolume, fVolume );

m_pWebView->GetMainFrame ()->ExecuteJavaScript ( strJSCode, "", 0 );
std::vector<CefString> frameNames;
m_pWebView->GetFrameNames(frameNames);

for (auto& name : frameNames)
{
auto frame = m_pWebView->GetFrame(name);
frame->ExecuteJavaScript(strJSCode, "", 0);
}
m_fVolume = fVolume;
return true;
}
Expand Down Expand Up @@ -426,7 +433,7 @@ void CWebView::Resize(const CVector2D& size)

CVector2D CWebView::GetSize()
{
return CVector2D(m_pWebBrowserRenderItem->m_uiSizeX, m_pWebBrowserRenderItem->m_uiSizeY);
return CVector2D(static_cast<float>(m_pWebBrowserRenderItem->m_uiSizeX), static_cast<float>(m_pWebBrowserRenderItem->m_uiSizeY));
}

bool CWebView::GetFullPathFromLocal ( SString& strPath )
Expand Down

0 comments on commit 63fe60b

Please sign in to comment.