yesyesok Posted April 12, 2015 Posted April 12, 2015 I saw a video of MTA in which a player was using YouTube in-game Does anyone knows what functions should i use to create the?
xXMADEXx Posted April 12, 2015 Posted April 12, 2015 I saw a video of MTA in which a player was using YouTube in-game Does anyone knows what functions should i use to create the? It uses browser functions coming in MTA 1.5. https://wiki.multitheftauto.com/wiki/Cli ... _functions You can download MTA 1.5 nightly here.
Mr.unpredictable. Posted April 12, 2015 Posted April 12, 2015 It will easier for people to do that in Mta1.5 Check this https://wiki.multitheftauto.com/wiki/GuiCreateBrowser example from wiki --In order to render the browser on the full screen, we need to know the dimensions. local screenWidth, screenHeight = guiGetScreenSize() --Let's create a new browser in remote mode. local window = guiCreateWindow(200, 200, 1024, 768, "Webbrowser", false) local browser = guiCreateBrowser(0, 0, 800, 600, false, false, window) -- The event onClientBrowserCreated will be triggered, after the browser has been initialized. -- After this event has been triggered, we will be able to load our URL local theBrowser = guiGetBrowser(browser) -- Get the browser element from gui-browser addEventHandler("onClientBrowserCreated", theBrowser, function() -- After the browser has been initialized, we can load [url=http://www.youtube.com]www.youtube.com[/url] loadBrowserURL(source, "http://www.youtube.com") end )
yesyesok Posted April 12, 2015 Author Posted April 12, 2015 I downloaded the nighty 1.5 and this example isn't working in MTA 1.5
xXMADEXx Posted April 12, 2015 Posted April 12, 2015 I downloaded the nighty 1.5 and this example isn't working in MTA 1.5 Are you sure you started the mta 1.5 client AND the mta 1.5 server? Also, it's a client script.
yesyesok Posted April 12, 2015 Author Posted April 12, 2015 I downloaded the nighty 1.5 and this example isn't working in MTA 1.5 Are you sure you started the mta 1.5 client AND the mta 1.5 server? Also, it's a client script. ya I'm sure, It loaded the gui window but not YouTube.
xXMADEXx Posted April 12, 2015 Posted April 12, 2015 anyone? guiCreateBrowser might not be implemented yet.
Mr.unpredictable. Posted April 13, 2015 Posted April 13, 2015 Alternatively you can try this createBrowser dxDrawImage loadBrowserURL local webBrowser = createBrowser(1000, 1000, false, false) function webBrowserRender() dxDrawImage(0, 0, 1000, 1000, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true) end addEventHandler("onClientBrowserCreated", webBrowser, function() loadBrowserURL(webBrowser, "https://www.youtube.com/tv#/watch?mode=transport&v=jofNR_WkoCE") addEventHandler("onClientRender", root, webBrowserRender) end) Here's the preview of this example. http://i.imgur.com/aFkHr6T.png
yesyesok Posted April 13, 2015 Author Posted April 13, 2015 Awesome I wanted to make it more real, What should i do? like i will be able to search in it and also able to click videos.
xXMADEXx Posted April 13, 2015 Posted April 13, 2015 You need to use the injectBrowserMouseDown/injectBrowserMouseUp/injectBrowserMouseMove/injectBrowserMouseWheel functions.
Mr.unpredictable. Posted April 13, 2015 Posted April 13, 2015 any example for 4 th function? Check again i've added an Example https://wiki.multitheftauto.com/wiki/In ... el#Example
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now