Loading...
Processing Forum
Recent Topics
All Forums
Screen name:
spearzachary
spearzachary's Profile
1
Posts
0
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Expanded view
List view
Private Message
Play Video By Pressing Button, I only hear the audio
[1 Reply]
27-Nov-2011 07:44 PM
Forum:
Core Library Questions
I'm doing a simple media gallery for a school project and I'm running into a problem.
I've got so-called buttons, they're just screenshots of the video that they're suppose to play.
When I click the button all I hear is the audio. Either the video doesn't show up or it's playing underneath everything. I don't know how to fix it.
Any input will help.
Thanks in advance!
import processing.video.*;
PFont myFont;
//THUMBNAILS
PImage myImage1;
PImage myImage2;
PImage myImage3;
PImage myImage4;
PImage myImage5;
PImage myImage6;
PImage myImage7;
PImage myImage8;
PImage myImage9;
PImage myImage10;
PImage myImage11;
PImage myImage12;
PImage myImage13;
//VIDEO FILES
Movie myMovie1;
Movie myMovie2;
Movie myMovie3;
Movie myMovie4;
Movie myMovie5;
Movie myMovie6;
Movie myMovie7;
Movie myMovie8;
//FOR PLAY/PAUSE FUNCTION WHEN I GET THERE.
int placeHolder;
void setup() {
size(1024, 768, P3D);
frameRate(30);
myImage1 = loadImage("backgroundImage.png");
background(myImage1);
/*
NOT SURE IF I'M SUPPOSED TO HAVE THIS SO IT'S COMMENTED OUT
myMovie1 = new Movie(this, "djKatnipz.mp4",30);
myMovie1.stop();
myMovie2 = new Movie(this, "streetRules.mp4",30);
myMovie2.stop();
myMovie3 = new Movie(this, "bestBirthday.mp4",30);
myMovie3.stop();
myMovie4 = new Movie(this, "douchebagShootout.mp4",30);
myMovie4.stop();
myMovie5 = new Movie(this, "gravityGun.mp4",30);
myMovie5.stop();
myMovie6 = new Movie(this, "risk.mp4",30);
myMovie6.stop();
myMovie7 = new Movie(this, "planking.mp4",30);
myMovie7.stop();
myMovie8 = new Movie(this, "mortalKombat.mp4",30);
myMovie8.noLoop();
*/
fill(#FFFF00);
myFont = loadFont("BankGothic-Medium-60.vlw");
textFont(myFont, 60);
text("Media Gallery", 273, 90);
myFont = loadFont("BankGothic-Medium-20.vlw");
textFont(myFont, 20);
text("Created By: Zachary Spear", 700, 750);
myFont = loadFont("BankGothic-Medium-20.vlw");
textFont(myFont, 20);
text("High Dynamic Range Photos", 20, 140);
myFont = loadFont("BankGothic-Medium-20.vlw");
textFont(myFont, 20);
text("Comedic Shorts", 20, 354);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("DJ Katnipz", 40, 490);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Street Rules", 290, 490);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Best Birthday Ever", 540, 490);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Douchebag Shootout", 780, 490);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Gravity Gun IRL", 40, 667);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Game of Global Domination", 290, 667);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("X-treme Planking", 540, 667);
myFont = loadFont("BankGothic-Light-14.vlw");
textFont(myFont, 14);
text("Fatalities", 780, 667);
myImage2 = loadImage("macie1.jpg");
image(myImage2, 38, 156, 204.8, 136);
myImage3 = loadImage("macie2.jpg");
image(myImage3, 288, 156, 204.8, 136.8);
myImage4 = loadImage("hdr1.jpg");
image(myImage4, 538, 156, 204.8, 136.5);
myImage5 = loadImage("cityscape.jpg");
image(myImage5, 788, 173, 204, 110);
myImage6 = loadImage("djKatnipzImage.jpg");
image(myImage6, 38, 370, 204, 110);
myImage7 = loadImage("streetRulesImage.jpg");
image(myImage7, 288, 370, 204, 110);
myImage8 = loadImage("bestBirthdayImage.jpg");
image(myImage8, 538, 370, 204, 110);
myImage9 = loadImage("douchebagShootoutImage.jpg");
image(myImage9, 788, 370, 204, 110);
myImage10 = loadImage("gravityGunImage.jpg");
image(myImage10, 38, 547, 204, 110);
myImage11 = loadImage("riskImage.jpg");
image(myImage11, 288, 547, 204, 110);
myImage12 = loadImage("plankingImage.jpg");
image(myImage12, 538, 547, 204, 110);
myImage13 = loadImage("mortalKombatImage.jpg");
image(myImage13, 788, 547, 204, 110);
}
void draw() {
/*
NOT SURE IF I'M SUPPOSED TO HAVE THIS SO IT'S COMMENTED OUT
image(myMovie1, 1, 1);
myMovie1.read();
image(myMovie2, 1, 1);
myMovie2.read();
image(myMovie3, 1, 1);
myMovie3.read();
image(myMovie4, 1, 1);
myMovie4.read();*/
}
void mouseReleased()
{
int value1 = mouseX;
int value2 = mouseY;
if (value1 >= 38 && value1 <= 242.8 && value2 >= 156 && value2 <= 292)
{
myImage2 = loadImage("macie1.jpg");
image(myImage2, 105, 156, 819, 544); //FIX DIMENSIONS
}
else if (value1 >= 288 && value1 <= 492.8 && value2 >= 156 && value2 <= 292.8)
{
myImage3 = loadImage("macie2.jpg");
image(myImage3, 105, 156, 819, 544); //FIX DIMENSIONS
}
else if (value1 >= 538 && value1 <= 742.8 && value2 >= 156 && value2 <= 292.5)
{
myImage4 = loadImage("hdr1.jpg");
image(myImage4, 105, 156, 819, 544); //FIX DIMENSIONS
}
else if (value1 >= 788 && value1 <= 992 && value2 >= 173 && value2 <= 283)
{
myImage5 = loadImage("cityscape.jpg");
image(myImage5, 135, 196, 768, 432); //FIX DIMENSIONS
}
else if (value1 >= 38 && value1 <= 242 && value2 >= 370 && value2 <= 480)
{
myMovie1 = new Movie(this, "djKatnipz.mov");
myMovie1.noLoop();
}
else if (value1 >= 288 && value1 <= 492 && value2 >= 370 && value2 <= 480)
{
myMovie2 = new Movie(this, "streetRules.mov");
myMovie2.noLoop();
}
else if (value1 >= 538 && value1 <= 742 && value2 >= 370 && value2 <= 480)
{
myMovie3 = new Movie(this, "bestBirthday.mov");
myMovie3.noLoop();
}
else if (value1 >= 788 && value1 <= 992 && value2 >= 370 && value2 <=480)
{
myMovie4 = new Movie(this, "douchebagShootout.mov");
myMovie4.noLoop();
}
else if (value1 >= 38 && value1 <= 242 && value2 >= 547 && value2 <= 657)
{
myMovie5 = new Movie(this, "gravityGun.mov");
myMovie5.noLoop();
}
else if (value1 >= 288 && value1 <= 492 && value2 >= 547 && value2 <= 657)
{
myMovie6 = new Movie(this, "risk.mov");
myMovie6.noLoop();
}
else if (value1 >= 538 && value1 <= 742 && value2 >= 547 && value2 <= 657)
{
myMovie7 = new Movie(this, "planking.mov");
myMovie7.noLoop();
}
else if (value1 >= 788 && value1 <= 992 && value2 >= 547 && value2 <= 657)
{
myMovie8 = new Movie(this, "mortalKombat.mov", 30);
myMovie8.play();
}
else
setup();
}
«Prev
Next »
Moderate user : spearzachary
Forum