When I load up the video player for the first time, the volume slider is set at 0 but the volume controls shows its at level 3 (the volume is on so the volume button is correct, the slider is not). Once you touch the volume slider or the volume button, the issue corrects itself.
How can I get the slider and the volume button to be synchronized the first time?
Thanks in advance!
By default the volume is set to Max.
Would you tell me which version of video.js do you use?
although check if the following commands are useful for you or not
// get the current volume of the media
var howLoudIsIt = myPlayer.volume();
// set the volume to a new value
myPlayer.volume(0.5);
// 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Related
I'm not sure why, but for some reason whenever the camera in my game moves, everything but the character it's focusing on does this weird thing where they move like they should, but they almost vibrate and you can see a little trail of the back of the object, although it's very small. can someone tell me why this is happening? here's the code:
x+= (xTo-x)/camera_speed_width;
y+= (yTo-y)/camera_speed_height;
x=clamp(x, CAMERA_WIDTH/2, room_width-CAMERA_WIDTH/2);
y=clamp(y, CAMERA_HEIGHT/2, room_height-CAMERA_HEIGHT/2);
if (follow != noone)
{
xTo=follow.x;
yTo=follow.y;
}
var _view_matrix = matrix_build_lookat(x,y,-10,x,y,0,0,1,0);
var _projection_matrix = matrix_build_projection_ortho(CAMERA_WIDTH,CAMERA_HEIGHT,-10000,10000)
camera_set_view_mat(camera,_view_matrix);
camera_set_proj_mat(camera,_projection_matrix);
I can think of 2 options:
Your game runs on a low Frames Per Second (30 or lower), a higher FPS will render moving graphics smoother (60 FPS been the usual minimum)
another possibility is that your camera is been set to a target multiple times, perhaps one part (or block code) follows the player earlier than the other. I think you could also let a viewport follow an object in the room editor, perhaps that's set as well.
Try and see if these options will help you out.
If your camera is low-resolution, you should consider rounding/flooring your camera coordinates - otherwise the instances are (relative to camera) at fractional coordinates, at which point you are at mercy of GPU as to how they will be rendered. If the instances themselves also use fractional coordinates, you are going to get wobble as combined fractions round to one or other number.
I'm using Adobe Animate HTML5 to create a board game to run on Smart TV (low-performance machine).
All my previous games were done using AS3.
I quickly found there is no way to create a Sprite anymore (A movie clips with only 1 frame).
After creating my board game (no code yet just elements) which is basically movie clips inside other movie clips. All single frame.
I checked the FPS on LG TV and so it is done from 60 to 20. On a static image.
After research, I found that is the advance method in MovieClip class there is a constant check to update the frame.
I added a change to check if the MovieClip class total frame is equal to 1 to change it the mode of the MovieClip to a single frame. This increases performance back to 60 FPS.
Who do I go to, to check and maybe fix/"add a feature" to the code of createjs
Thanks
code issues or suggestions can be logged here https://github.com/CreateJS/EaselJS/issues for CreateJS. All the best.
inside html-code in script part there is a line
createjs.Ticker.addEventListener("tick", stage);
Remove it and call the update manually when you need it (when something has changed)
stage.update();
I am writing a MacOS or OSX application where I need to record only the View of my application (Not the Whole display) with the Audio it emits.
Think it as a game app and I need to record the complete GamePlay View Of the Application.How should I go about doing this?
I am aware of "AVCaptureScreenInput" and, the example. But how to capture only the view of my application?
From the website you posted:
Note: By default, AVCaptureScreenInput captures the entire screen. You may set its cropRect property to limit the capture rectangle to a subsection of the screen.
Just set this property to the windows/views rect and you're done
Of course you need to update and restart the recording when the windows/views rect changes.
Read the document carefully, there is a comment, about the displays:
// If you're on a multi-display system and you want to capture a secondary display,
// you can call CGGetActiveDisplayList() to get the list of all active displays.
// For this example, we just specify the main display.
// To capture both a main and secondary display at the same time, use two active
// capture sessions, one for each display. On Mac OS X, AVCaptureMovieFileOutput
// only supports writing to a single video track.
Hi its a simple question to a hard problem (for me so far anyway)
i dont consider myself to be a beginner programmer but for the love of god I cannot seem to be able to figure this one out.... I currently have a problem related to updating a uiimageview.. its not being updated when my slider moves left and right.. it does slow the application down a little bit when i drag it which tells me there are processes happening and tells me they are connected correctly the itnerface with their methods.. whats happening or what im doing at the moment is trying to retrieve image data for a specific frame specified by time to then be able to select it as a thumbnail depending on the position of the uislider. so its a manual thumbnail picker.
I have tried many things both by connecting it through interface builder and by doing it programatically.
this is what i have one so far:
.h file
.m file
the slider method for sliderValueChanged which gets called
and finally my class method that i use to help retrieve a thumbnail image returning nsdata... passing in a video and a specified time position.
I have read here on stackoverflow that updating a uiimageview can cause memory leaks if updated regularly since it caches images.. and to use [UIImage imageWithData:] instead to avoid any leaks etc. so i have implemented this in my code yet my thumbnail view still fails to load the images based on the slider's position. (the slider is created to have the min and max values set from 0 - to the duration of the video so that the slider can only ever have a value that can correctly pick a time frame in the video in question)
If anyone could guide me in how i could fix this problem.. it is beyond me for hours now! i appreciate the help. thank you
I realised what was happening here... the slider values i had passed into my method werent appropriate for what i required.
in the class method it says CMTimeMake(value 1, value 2).. and after doing some research i understood how it worked.
basically there is a time interval you specify in value 2 in my case it was 60.. based on some code i copied.. whatever you substitute value 1 for becomes a part of the time interval.. They are a numerator and denominator, so 1 /60 equals 1 60th of a second
2/60 is equal to the time position of 2 60th of a second... if i wanted 3 seconds i would need to do 60*3 = 180 so
180/60 equals 180 60th of a second which equates to 3 seconds in total... so because my slider values were mapped to the duration of the video which the maximum was 15 seconds... the higest time frame i could get using the code i wrote in my question... i could only get the
15 60th of a second. which time frame wise not really a difference between the 1st 60th of a second hence the reason why i could not see the uimageview being updated...
so to correct this i multiplied my slider values by 60 so that each value that gets changed because they were mapped to seconds.. i multiplied by 60 .. and of course the image updated like a charm. however now i need to figure out how to speed up this process since at the moment it seems synchronous as it lags the interface greatly
I created a custom Camera Control with overlay ...
Now i am zooming image by using Slider by ..
imagePickerController.cameraViewTransform = CGAffineTransformScale(initialTransform,
MainSlider.value, MainSlider.value);
where initialTransform is the initial image transformation ...
MainSlider is slider , which i use to get zoom level from 1 to 4
So each time when i increase image using Slider ... I refer initialTransform and zoom accordingly Slider value ...
I am able to zoom by doing this .. But when i capture photo using
[imagePickerController takePicture];
It gives me Original Picture only .. does not give me any EditedImage ...
This original image is same as without zoom ...
I want to get Image which was zoomed ...
Means whatever showing in screen ...
I try to find a lot for this,,,, I know we can use GetScreenCapture()
but it can be cause of rejection of app and also it lower down the image quality ...
You need to apply the same transform to the image after it has been captured. Setting cameraViewTransform will only affect the display, as you've noticed. When you apply a uniform scaling transform (e.g. to zoom) this is a digital zoom. You are not increasing the pixel resolution. You'll get the pic back from the camera and then you can crop/scale it to the size you want when processing the image. You should do your processing on a background thread to minimize disrupting the main thread.