With the structure of the quiz now working, I moved on to replacing the images that load into the end of the structure with gifs.
First I started by building in the gif library, the same way we had learned to use it in A.06: Processing Week 4. However, I was faced with an error, stating that the library was out of date.
To try to rectify this, I moved back to version 2 of Processing from version 3 as it didn’t seem to matter much to my project which version I used. Unfortunately, this was not the case, processing threw out a more complicated error which I couldn’t debug.
I decided to try again in Processing 3, firstly because I felt the gif library would be easier to fix than this unknown error, and secondly because I know it is good practice to work with the most up to date version of the software.
I continued to look through processing.org, GitHub and other sites and forums for the gif library compatible with Processing 3. I found one and replaced gif library, but this didn’t work either. I later discovered, while talking to Spencer, that this had actually also been a library for Processing 2 and was published is 2015.
Next, I rearranged my sketch so that the gif would load as an image sequence. After exporting the video as jpegs, I made an array to contain all the images and then a for loop to load them in.
This for loop had to load in 120 images for just one shot, this slowed down the quiz significantly. I knew that this was not going to be a viable option.
With no more options or ideas left, I brought the issue to Spencer. Following his instructions, I checked the built in contribution manager for processing 3 and it showed that P3 doesn’t have a compatible gif library available.
This is clear now, since I remember that extrapixel was the name of the site where we were able to download the version 2 gif library in the Week 4 Processing session.
Processing.org has no gif library for processing 3, but it does have a Movie Library. I downloaded and added it, but still the video would not play. I checked through the code, using the example given on the site to make sure i’d utilised the library correctly.
Spencer recommended I isolate the vital piece of code from the main sketch, seeing if it would work by itself, this still did not load the video, which points out that there is something wrong with the code. Sure enough, there was a missing function called void movieEvent and some wrong syntax.
Frustratingly the video would still no load. I resorted to opening the test sketch to see if the sample video played through. The original works but when replaced with my video, it doesn’t play. Making a reduced test reveals that the file type is the issue, here.
With the fixed file type, my sketch finally works. Here is a screen recording of the video playing within the reduced test file.
After trying the same shot in many forms (gifs, images and videos) I finally had a working sketch. Now to put it into the full quiz.