Showing posts with label Week7. Show all posts
Showing posts with label Week7. Show all posts

Friday, 1 October 2010

5.Week 9

Dear Diary,

Browser compatibility is the bane of my life.

Working on the upload system atm for SilverstreamTV . Uploading works fine, had a few teething issues as i have stated in previous posts. I am currently working on deploying and developing the system on a live server which is quite a big deal bare in mind 3 months ago i didn't know how to code javascript or php. let alone combine it with as3, html, css and mysql.

So after developing the...upload widgets i am now using their original upload system to create an up to date easier to use and hopefully more aesthetically pleasing uploading and modifying tool.

The past few days i have been working on the database submissions and edit section. The issue came about when trying to upload a new thumbnail. The thumbnail generator takes in the video name via ExternalInterface:

  var flashvariable = window.document.swfid;
   flashvariable.changeText("hello" + orvariablename);
  window.location ="#";

this sends the variable (which would be my video name) to the thumbnail generator which would kick start the widget.

you may think whats the issue....well I'm not using a button in my edit page, i need the thumbnail generator to load when the page loads, so it needs to insert the variable straight away....i thought it was an easy onload function. Well different browsers deal with code differently i don't know the ins an outs of it. But i had to test each browser with different solutions. 

window.onload worked fine in IE, Opera and Navigator.


so we are left with Firefox, Chrome and Safari.....and also you need to get javascript to find out which browser the visitor is using.

if you check for safari before you check for google chrome, it will  for some reason result in an alert saying your using safari (if you enable the alerts) (see below) but this is how i got it to work.

window.onload function cross browser Internet Explorer, Firefox, Safari, Opera, Chrome and lets not forget Navigator....


// detect browser and act accordingly
           
            if (navigator.userAgent.indexOf("MSIE") != -1) {
                //alert("You are running Microsoft Internet Explorer.");
                window.onload=chosenFunction; // IE Works
            }else if (navigator.userAgent.indexOf("Firefox") != -1) {
                //alert("You are running FireFox.");
                if (document.addEventListener) // Firefox Works
                {
                document.addEventListener("DOMContentLoaded", chosenFunction, false); // Call chosenFunction in     Firefox
                }
            }else if (navigator.userAgent.indexOf("Navigator") != -1) {
                //alert("You are running Netscape.");
                window.onload=chosenFunction; // Navigator works
            }else if (navigator.userAgent.indexOf("Opera") != -1 ) {
                //alert("You are running Opera.");
                window.onload=chosenFunction; // Opera Works :)
            }else if (navigator.userAgent.indexOf("Chrome") != -1 ) {
                //alert("You are running Chrome.");
                setTimeout(chosenFunction, 300); // Google Chrome Works:)
            }else if (navigator.userAgent.indexOf("Safari") != -1 ) {
                //alert("You are running Safari."); // Safari Works
                setTimeout(chosenFunction, 500);
            }else {
                alert("You are running some odd-ball browser.");
            }


function chosenFunction(){
 // do stuff
}


So now i have done the "not as easy as it should have been" thumbnail editor... i am now free to continue with the upload system...... wish me luck!

Friday, 17 September 2010

4.Week 7

Dear Diary,

Im sorry I seem to have neglected you. It has been 3 weeks ish since my last post. Progress so far..

All bugs have been fixed on the uploader for Flashpoint2, when ovewriting a video on upload it is no longer saved into the "Large Image" folder. I had a sudden brain wave a couple of days ago. My issue was when the php refered back to the flash to check if it was ok to overight the file. The extension wasnt sent back to the php so it through my verification off. To solve this issue i kept the extension in a session variable solving the issue and finally fixing a problem i have had for weeks. It just goes to show you if you have a problem which you cant solve at the moment, leave it and come back to it with a clear head.

The game i have been working on is nearing its climax, pretty much all the elements are in place. The maze is constructed, almost all the video elements work and the models look....well ok... good enough for a prototype. Take a look:



The only issue with the game i have at the moment is when you go to the scissors or saw in the game a video is supposed to come up and ask you why you need them.....the video comes up, but no sound is present. I have changed the volume, set to awake, asked it to loop to no avail. I like to think its unities problem.

My role in the companie diversified this week. With SkillsCymru coming up (from today through to Saturday) we were in need of some video questions about careers to add to our footage and enable students from further affar to ask questions which would then be answered by industry proffessionals. The clips chosen will become part of the final piece which will be present on the SkillsCymru website.

I was asked on Monday if i wanted to take up the challenge, so i set about researching different colleges in the north of wales, a few of which had not even started term. Long story cut short wit help of work experience attende Emma we managed to get 2 colleges to upload their footage to youtube and send us the links. I am awaiting the result from the team.....