How do I detect what browser the user is using?

  • Hi Guys

    any suggestions on how to detect what browser the user is using (on laptop/computer)?

    Thanks you

  • What do you need this for? Generally you should avoid it. What usually happens is people write code that only works in certain browsers, then the browser makers realise websites are broken in their browser, so they make their browser pretend to be a different browser to fix it. This has happened so much that basically all browsers pretend to be a series of other current and past browsers.

  • Ashley--it's an honour dude.

    OK so the browser recognition was my solution to the below.

    I can't figure out how to get construct to recognise when an embedded video ends and so I decided to go with Webm video medium in order to easily be able to control actions directly after video finishes. However I believe that the webm format is not going to be widely compatible.

    Ultimately I've got to much video to include it in a project so a little buggered right now..

  • Or maybe there's a way of downloading more vodeo files to the project later when the user needs it...?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I'm still not sure what you're trying to do or why you think you need to detect the browser to solve it. The format of the video should not have any effect on your ability to identify when it ends.

  • I'm assuming Kelvin is using WebM for its superior file size, and that any alternatives are simply too big.

    WebGL2 has weaker support than WebM, so I'd use it with impunity, as if the browser doesn't support WebM, it probably wouldn't support C3 to begin with

    EDIT//

    You might want to look into the iframe plugin and YouTube for streaming video through your game

  • Ashley- the iframe plug in has no way of recognising when an embedded video has finished playing i.e on video finished > action. Using the video plug in works perfectly for what I need however I have many videos that I would need to import into the project hence Webm due to filesize and having a popup tell users to use Chrome browser instead (to ensure compatability).

    This is why I also wondered if there is a way to download videos to the webapp during use and not just when you initially load the page.

    Elliot- I'm fairly new to all this so this helps.

    Ultimately, my whole problem is solved by the iframe being able to recognise when an embedded video finishes playing.

    Thanks guys

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)