Website Add-On Suggestions


#21

I’ll do my best but it looks like the code for that exaclty is in webtorrent.min.js which is a minimalist version of just the basic essentials of the web application. So it is NOT formatted.

I believe though the source it’s defined it is the one I just showed above, var file = torrent.files[0] in the 6th line of the JS code.

I’m willing to go in any direction. I may include the JS in the page scripts or src them but most likely src them if I can. Also I don’t really care so long as I can edit just this one var with it. When I can do that then the rest of the CSS I’m going to put into linked files but that CSS won’t be this var.

So if needbe to edit this var I’ll do any of the three with no one being better an option than the other.


#22

This is the answer I needed:

I’d try providing a callback to see if an error is being passed in:

file.appendTo('#vidcontent', function (error, element) {
  if (error) {
    console.log('Something went horribly wrong');
    throw error;
  }
 
  console.log('Appended a new video');
});

Assuming you’re putting your CSS into the page correctly somehow, what you describe should work fine, so there has to be an issue in exactly how you’re putting it all together. If you can, include the final and complete source (not including the webtorrent code).

Do you see any console errors (in the browser’s developer tools) when you load the page?


#23

Alright well at first glance I’m going to try to style the id with CSS using the <style></style> tag and probably the language="text/css".

I’m not too sure what you mean by browser developer tools I’m using chrome though, (so far one of the only browsers in support of the webrtc).

Hopefully it all shakes out, sorry I couldn’t have replied sooner I don’t always have my computer over the weekends and we had a bunch of family stuff to boot this weekend :neutral_face: :droplet:

I’m going to try to write it up from memory somewhat right now but it might not function properly.

[quote]
`

If I Can be seen after 60 seconds and no other error we have an issue.
#vidcont.div {width:320px;height:180px;border: 1px solid #ff0000;}#vidcont {width:320px;height:180px;} `[/quote] Alright I ran that and none of the errors came through :| so I'm going to do some more looking I may have to figure out how to install node.js or something since the whole application runs off of that and I'm trying to use the min.js file.

#24

Alright, a bunch of stuff:

First off, while this is the topic of raging debate, you have to be careful with automatic semi-colon insertion (ASI) in JavaScript. Yes, theoretically semi-colon’s are optional, but leaving them out is not equivalent to having them in. If you don’t use semi-colon’s at the end of lines everywhere, the JavaScript runtime will decide where statements should be broken up, and sometimes it does strange things. Personally, I just find it easier to always put them in (then again, that’s a bias I might have carried with me from Google which enforces that policy). Here’s more information if you care.

Side note: you want your style tag in the head section of the page, and you a) don’t need to specify text/css these days, but b) if you do you want to use type=text/css not language=.... You also you don’t need the type attribute on your script tag either (the language attribute was actually never standardized and shouldn’t be used).

If you don’t know about browser dev tools, you’re in for a treat. IE and Firefox have improved theirs a lot lately, but Chrome’s dev tools are just the bees knees. They allow you to do all kinds of things: see what assets came in with the page, see network requests and timing, do performance profiling, step-debug your JavaScript, inspect your HTML and CSS interactively, run interactive JS code, etc. Super, super useful. Get good with them and your life will get so much better. Here’s some documentation for Chrome dev tools.

Open up your Chrome developer tools console on this test page you’re working on by ctrl+shift+j (or ctrl-opt-j on Mac). Then refresh the page. Do any errors show up in the console?


#25

Alright yeah I was confused by the WebTorrent JS code because I saw a surprizingly small number of semicolons and in my experience with PHP and my very very minor experience with C++ and C# there was supposed to be a function to end every line or function that and all the JS tutorials I find have them too. So I’m going to try to see what I can do to clean it up but to keep the code formatted I’m probably going to have to share it via JS fiddle(I can just post the link) because when I try to say put a <html> tag in the and try to put a blank line in between it disappears same for anything :neutral_face:.

Thanks for that I wasn’t too sure about it I know it CAN function without the language or type specifications just figured it couldn’t have hurt.

Ok so these tools look awesome :smiley: thanks for pointing them out to me man :wink: with this though I need to start formatting my code again. I’ve been using notepad cause my notepad++ copy is on a pen drive that I lost, need to find that :droplet:

Strangely enough though absolutely nothing shows up da na da na da na danananana I’ll be back with some better stuff soon enough. :confused:


#26

About language vs type, one is actually standardized (type) and one isn’t. It’s from the early days of the web where it wasn’t clear what possible languages and stylesheet specifications might arise, but after 2+ decades, all we have is JS and CSS, so people don’t bother to specify anymore.

Yikes Notepad is the worst. Atom is a free, open-source editor that’s quite good and made by GitHub (speaking of which, are you using some form of source control for your project? you should be!). I don’t use it, but it’s pretty similar to other great options out there.


#27

Well I have a GitHub account and don’t know how to use it. I don’t hardly have any source yet cause I need to figure out the JS so I can start making loopholes in it for SQL queries and PHP forms. Because the WebTorrent code only functions in 100% JavaScript/HTML :neutral_face:

I just have a library in my computer called “code” there isn’t anything other than some example code and sources for tutorials on certain subjects. And lots of failed JS :\


#28

Mkay so I just finished cleaning most of it out and writing up some sample webTorrent protocol kind of stuff like basic stream functions or blob URL kind of stuff. I’m also looking into http://webtorrent.io/docs I saw you pull some stuff from it earlier so I’m trying to look into that.

There’s also a project doing something similar to what I’m trying to do called fastcast.nz and they have their source on gitHub and it has the kind of video container that I’m trying to achieve but everything has been buggy lately so I’m trying not to take too much from them.

Edit

Okay so I’m pretty desperate at this point :neutral_face: so I’m going to fish around to see if I can find one of my live USBs running linux because windows and node.js don’t mix so let’s hope it works out.

I have a USB running either Ubuntu or Linux Mint both which I can use to install node.js and browserify the real tools I need to run WebTorrent.

I can’t install cygin or whatever it is because I’m on my school laptop and my linux PC is an ex bluescreen and needs a new fan ATM.

EDit#2

This officially sucks. I found the drive and booted it no issue. . . . … . . … . . . . … . . … . . . . … . . … . . . . … . . … . . . . … . . … . . . . … . . … . . . . … . . … and then forgot the password. I have no idea what I put down as a password but it wasn’t any of the 20 passwords I tried. I recall having one that was like ***REDACTED*** or something ridiculous like that and then I wrote it down and later burned the paper cause I thought I deleted all the accounts with that password :neutral_face:

I’m looking around on TuxTracker for a live DVD copy of an OS now cause I’m exahausted and it’s already 10:00 here and don’t have permissions format USBs on this account. Any recommendations if you’re on at the moment @Daniel?

I’m probably just going to go with something Debian based. That should work so probably like Ubuntu, Xubuntu, Linux Mint, Fedora, Red Hat, Kali Linux, or something. I think Kali Linux is the smallest and most hacker/coder friendly and therefore should burn the fastest so I’m probably going to go with that.


#29
  1. Yeah don’t use Windows. Windows and 97% of software development don’t mix. MSFT is trying to change that, but pretty much no tech company in the modern world uses Windows for development or deployment…and it’s for a reason. You can’t really take advantage of all of the OSS out there without using Linux. EDIT: well UNIX really, so Linux, Mac OS (which is based on BSD)…

  2. Dude just get Ubuntu straight from the source: http://www.ubuntu.com/download/desktop

  3. Careful not to post your passwords online (even if they’re old and you think you don’t use them). Fixed it for you.

  4. Regarding source control, if you really are just dicking around it’s fine to just have a bunch of loose files. The minute you actually start working on your project for real, get that sucker in source control. You can use git or another source control system (but seriously just use git; it’s the de facto standard these days), and the easiest way to get going with that is to use GitHub…so dust off that account and get going! We can always help with that stuff. Git’s not easy, but it’s well worth it.


#30

Mkay yeah I knew that coming in but figured I’m bullheaded enough to try till I start part timing this summer *(after I turn 15) to earn enough for a monitor for my REAL PC.

I already downloaded Kali it’s Debian based too and from the tracker I got 5+ MB/s speed which I’m sorry but can’t pass up. Also I have more experience with Kali than Ubuntu even though my step dad is a total Ubuntu nut I kind of lived in the lower middle class for like ever and ran windows XP till 2010 or so. Ubuntu is just too pretty don’t know. Kali is more of the bare essentials :neutral_face:

And sorry I should have clarified that wasn’t actually anything just an example of how ridiculous and complex the password was it was like 2x as long as that. I remember all the characters (which all weren’t there) and just not the order :frowning:

Yeah I plan on just dicking around until I can really start getting some serious videos done once there’s that I have a legitimate reason to focus on the code stuff. I am going to have a good time with Git I’m sure. But I may not be able to convert I may end up getting a Ext. HDD and just partitioning it and using it as an airgapped place to code.

Edit

I’m burning the live version of Kali now :slight_smile: hopefully I’ll have some results by 5am as far as source development goes

Edit#2

Alright so I got a disc done long story short I am using Linux mint now but it’s all off a live disc and debian based. Toniight I’m going to try tonight to tackle getting something functional setup. I’m going to setup the live disc and just take notes of the things I change and all that good stuff for when I reboot.