Jump to content

Cant Draw any local page with CEF


.:HyPeX:.

Recommended Posts

Posted

Well i've tried this out, but i cant get somewhat CEF to load the video.

Tried loading a basic HTML page locally, and drawing it, but it will be somehow drawn blank..

PD: No errors in debug

  
local browser = createBrowser(x,y,true,false) 
addEventHandler("onClientBrowserCreated", browser,  
    function() 
        loadBrowserURL(browser, "http://mta/local/html/file.html") 
    end 
) 
  
function BackGroundDrawing() 
dxDrawImage(0,0,x,y, browser,0,0,0)   
end 
addEventHandler('onClientRender', root, BackGroundDrawing,true, "high+6") 
  

HTML file:

  
  
<!DOCTYPE html> 
<html> 
<head> 
<title>Title of the document</title> 
</head> 
  
<body> 
The content of the document...... 
  
</body> 
  
</html> 
  

Posted

Okay, this is driving me nuts, for some reason the CEF wont load my mp4 file and just go blank. Also seems like texts are way small.

http://i.imgur.com/R6eOcO9.png

http://i.imgur.com/HORPAR2.png

<!DOCTYPE html>  
<html>  
<body>  
  
<button onclick="playVid()" type="button">Play Video</button> 
<button onclick="pauseVid()" type="button">Pause Video</button><br>  
  
<video id="myVideo" width="320" height="176"> 
  <source src="emp.mp4" type="video/mp4"> 
  Your browser does not support HTML5 video. 
</video> 
  
<script>  
var vid = document.getElementById("myVideo");  
vid.autoplay = true; 
vid.load(); 
  
function playVid() {  
    myVideo.play();  
}  
  
function pauseVid() {  
    myVideo.pause();  
}  
</script>  
  
<p>Video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p> 
  
</body>  
</html> 
  

Posted

The MPEG-4 codec is not supported due to licensing issues. Convert the video to a free codec like WebM or OGG (WebM compresses better though).

Posted
The MPEG-4 codec is not supported due to licensing issues. Convert the video to a free codec like WebM or OGG (WebM compresses better though).

Alright, thanks for that! Honestly i was already about to give up on this, but i guess i'll try doing that.

The file path should be the one http://mta/etc for the video path?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...