I need a way to change the video position programmatically without scrubbing or using the default scrubber. However, the position value is not a setter so how would I be able to do this?
Assuming you're using the VideoPlayerController from the video_player package you can seek to the position you want programmatically by using the seekTo() method.
controller.seekTo(Duration(seconds: /*any second you want*/ ));
To start video where you left off earlier try below code:
controller..initialize().then((_){
setState(() {
controller.play();
controller.seekTo(controller.value.position + lastduration);
});
});
It works for me
Related
I am trying to create a radio application via Flutter.
However, I cannot update the slider value when I increase or decrease the volume by iPhone button. I am using volume control and audioplayers packages.
Does this not do what you want: https://pub.dev/packages/volume_control
Found that in 5 seconds of searching pub. Please get to know the resources you have available.
If I understand correctly, the issue is detecting when the physical volume up/down buttons are pressed and updating the slider to match. I would check out hardware_buttons.
You should be able to listen for the button being tapped using something like this (from their example)
StreamSubscription _volumeButtonSubscription;
#override
void initState() {
super.initState();
_volumeButtonSubscription = volumeButtonEvents.listen((VolumeButtonEvent event) {
// do something
// event is either VolumeButtonEvent.VOLUME_UP or VolumeButtonEvent.VOLUME_DOWN
});
}
Then use volume_control to get the current volume
// Get the current volume, min=0, max=1
double _val = await VolumeControl.volume;
And finally call setState to update the slider with the current volume.
I have the awesome config like this below:
{ rule = { instance = "plugin-container" },
properties = { floating = false },
callback = awful.titlebar.hide },
I don't want to have my Youtube fullscreen really playing fullscreen, but instead it is playing within the window size. If I want to have fullscreen, I could do with Win+F shortcut.
With the config above it doesn't work. Whenever I click fullscreen, it is really playing fullscreen.
I am used to be an Ion3 user and in Ion3 it just works. I am wondering whether it is possible for Awesome to do like that?
Many thanks.
You can do that on the src attribute of your iframe by adding fs=0 parameter
<iframe w src="//www.youtube.com/embed/video_id?fs=0></iframe>
Parameters doc
I know this is old but found this while asking a similar question just now. Not sure it helps you much since I think you were trying to do the same thing I am (make it a permanent feature by adding something to rc.lua), but if you click YouTube's fullscreen button or have VLC fullscreen itself or whatever and THEN Super+F you will get the effect you want. It will defullscreen into its previous window size but the client still thinks it is in fullscreen mode.
Untested
client.connect_signal("property::fullscreen", function(c) if c.instance == "plugin-container" then c.fullscreen = false end end)
I have a problem. I did the first example (Alternativa for dummies part I) and it runs fine but only fills 1/4 of the screen when using Air for iOS. How can I change the resolution?
Here is a screenshot:
http://tinypic.com/r/34yo86q/6
Are you using this code to set up the camera?
camera.view= new View (stage.stageWidth, stage.stageHeight);
The problem comes from the fact that those values are not constant during the whole life of the app. When the app starts, it's possible that the stage resizes, and thus you wouldn't be getting the right values.
First you could set those properties (I do this in 99% of my AS3 projects).
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
Then add an event listener for stage resize, and in the handler write the stageWidth and stageHeight values to some vars you could then use to init Alternativa's camera. Or maybe wait for the event to trigger before setting up the camera.
stage.addEventListener(Event.RESIZE, checkSize);
The handler
public function checkSize(e:Event):void {
realWidth = stage.stageWidth;
realHeight= stage.stageHeight;
}
Here is Adobe's documentation on the event, with examples on how to use it.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#event:resize
I want to zoom image in blackberry torch.For this i am using ZoomScreen predefined class.It working but my problem is i need a screen which can contain header,some text and then one image which can be zoom in and out.
Thank you
ZoomScreen extends MainScreen, so you can set a title and a status for it by adding setTitle() and setStatus() functions. You can use normal adds too. Did you try this and did not work?
I'm interested in a CSS approach to disabling scrolling on the iPad. I'm using an input type of range to create a slider, but would like to prevent scrolling on the rest of the iPad to keep a fixed position of the body.
Does anyone have a foolproof method?
I'm an idiot...but nobody else answered this either. HERE IS THE ANSWER:
create a slider with the input type="range" and give it an id
add the following code to the page:
document.addEventListener('touchmove', function (e) {if(e.target.id != 'slider_id'){e.preventDefault(); }}, false);