Could you create a digital console akin to iframe or embed?

Started by
4 comments, last by everlive 8 years, 7 months ago

What I mean is, I can go to 4chan or Warthunder forums and embed a Youtube video and watch it on those sites. Could you do that with a gaming console? I am making a game and would like this kind of functionality. I don't want to invent it but I would certainly use it if it was a service or free as part of the W3C standards as my game would be in HTML5.

My goal if possible is to make it so that you could play on forums and blogs or whatever and not necessarily directly on the game's site.

Advertisement

Many games include WebKit that works like a browser inside the game.

Just beware that since it is a full browser with support for all the browser support, it requires significant resources on its own.

I don't see how frob's answer actually answers the question -- I think he answers the reverse question ("how can I embed blogs in my game") -- you want to be able to embed your game in a blog.

YouTube embed, and picture embed, is usually specially-supported by web sites. They recognize YouTube video URLs, and translate the URL into an <iframe src=""...> that points to YouTube, or some other such widget.
Pictures are generally especially supported for upload, or supported as target URLs of <img src=""...> tags.
In general, web forums do not support embedding of arbitrary, "Raw" <iframe=""...> content, which you would need to actually embed your game.

Now, CMS systems, and general websites, can easily embed foreign content. Either by including JavaScript libraries directly, or by the aforementioned <iframe=""...> tag. Thus, if you build a "lightweight" version of your game for the web which runs well in, say, a 400x300 pixel window, then you could easily provide the URL for embedding. This works for any site -- you can embed "<iframe src='http://gamedev.net/' width='400' height='300'></iframe>" in the HTML code of any website, and it will show a piece of the gamedev.net front page.
enum Bool { True, False, FileNotFound };

Since the original question was edited, my earlier answer doesn't fit the edited question. The updated parent post appears that you want to build a HTML5 game you can embed on another site's content, not create a game that additionally views web content.

While you can use an iframe or custom media tag to load a game on a site you don't control, I don't think it is a good idea for an intentional design.

First, you're basically asking for content thieves to embed links everywhere. Much like the concerns over people who would steal and reuse flash items, you're likely giving away the farm so anyone anywhere can use your content and you get nothing in return. YouTube mostly does okay with this by heavily branding the screen before and after playback, plus branding when the mouse is over it by showing a scroll bar with YouTube on it, even with that some people write their own code to un-brand or re-brand away from YouTube. Some HTML5 games are already suffering this fate where the game part is loaded as a frame in a game aggregator site. The players don't know you exist, the game aggregator gets the ad revenue, and you pay the bills for server bandwidth.

Additionally you're opening the door to cross site scripting issues and web attacks. While generally the security model limits communication between windows and frames to content from the same domain, there are many known exploits. Many script-blocking tools will block iframes under assorted circumstances, both because of annoying ads and because of potential security hazards.

And knowing 4chan, building a game so it can be embedded into 4chan seems like a really bad idea. Mostly just "because 4chan".

Additionally you're opening the door to cross site scripting issues and web attacks.


MOST (but not all) of the issues arise for sites that choose to allow embeds of rich, uncontrolled page elements. Your game still has to worry about whether a GET request is somehow scripted from a different domain or not -- a cross-site-request-forgery-token usually takes care of this.

Regarding someone "ripping you off" through embedding, a good way to avoid that is to require that the user logs in through the game before playing. Or just make the game's graphics (which are still served from your host) sufficiently clearly yours. Maybe the point is to actually allow as much embedding as possible? Ripping flash is actually slightly different, because that's a single "built file" that you can take, whereas a HTML5 game consists of more pieces, and if you can put some part of the game on the server, then it's not easy to somehow reuse it without your support/knowledge.

Anyway, the biggest challenge is finding places that allow embedding of non-video objects. Most forums do not. Some blogs do, so that's probably a channel you can support. Also, custom web sites of course support embedding whatever the web site developer chooses to embed.
enum Bool { True, False, FileNotFound };

To frob's point, I do not really see much of an issue with direct theivery or cross-scripting exposure with this, but then I am not fully familiar with what the W3C considers "OK" when it comes to something like an <embed> or <iframe>.

hplus0603 is close to what I was going for, I failed to point out that the game would be login required and all assets would sit on a server I solely have an account for. I thought something like a Youtube embed was nothing more than a screen or portal to the actual site, that is what I was going for.

I think the closest possible example would be Gametap, where they have all the games on their servers and emulate them to where you play through your monitor but never actually download the game directly. Playthrough streaming? I do not know, but I am surprised no one else has really tried this even with the risk as far as I knowl.

This topic is closed to new replies.

Advertisement