I it seem that it is not possible to animate a cameraZoom via. setLens.
I tryed to move the Cam backward and simultanuous Zoom via setLens.
Any Ideas?
Thanks!
function zoomLens(lens, endLens){
var tweenLens = new TWEEN.Tween(lens).to(endLens, 2000);
tweenLens.onUpdate(function(){
camera.setLens(lens);
});
tweenLens.start();
}
in renderloop :
TWEEN.update();
Related
I'm trying to create a plugin that'll add a sharing button to the videojs player's overlay when the user hovers over or pauses the video -- basically I want my element to fade in over the player when the controlBar is show and fade out when it's hidden. My hackish solution is to listen for the player's "controlsvisible" and "controlshidden" events and calling fadeIn/Out on my element when those trigger.
Is that the best hook I have available, or is there a preferred method?
Sample:
videojs.plugin('shareButtons', function(options) {
var shareBtn;
shareBtn = $('<span class="icon-share"></span>share');
shareBtn.click(function() {
return alert("share");
});
$(this.el()).append(shareBtn);
this.on("controlsvisible", function() {
return vjs.Component.prototype.fadeIn.call($("#player-share"));
});
return this.on("controlshidden", function() {
return vjs.Component.prototype.fadeOut.call($("#player-share"));
});
});
I'm actually in the process of updating this. You can see the CSS in my branch here:
https://github.com/heff/video-js/blob/feature/control-bar-fixes/src/css/video-js.less
You'll be able to use events (useractive/userpassive) or CSS classes (vjs-user-active/vjs-user-passive).
Please provide some help regarding :
I have created a map using esri.geometry.Multipoint, i want to change the color of particular marker onClick
event. I hav tried ,but its changing the all the marker color i.e applied on a full layer.
I am using arcgis javascript api3.5
layer.add(graphic);
map.addLayer(layer);
dojo.connect(layer,'onClick',layer,function(evt)
{
var g = this.graphics[0];
var symbolchange = esri.symbol.PictureMarkerSymbol('http://../resource/images/location.png', 50, 50);
g.setSymbol(symbolchange);
});
Thanx in advance....................
if you add a graphics to map
you can use this event
dojo.connect(map.graphics,'onClick',function(evt){});
but if you want do this with already layer
you can use it for 'featureLayer'
dojo.connect(layername, "onSelectionComplete", function (evt) {});
I read the entire API and dozens of related help topics but I dont manage to get with the code to help me do what I want.
This is what I need:
The video is muted by default.
When user click on fullscreen button the video is played with full volume.
How do I code this?
I understand I can mute my video adding myPlayer.volume(0) like this:
<script>
var myPlayer = _V_("video_1");
myPlayer.volume(0);
</script>
But how do I detect whether the video is in fullscreen or not?
I found the fullscreenchange event on the API but dont manage to implement it successfully. Any help will do my day. Thank you!
Listen for the fullscreenchange event and check the isFullScreen property of the player.
var myPlayer = _V_("video_1");
myPlayer.volume(0);
var onFullScreen = function(){
if (this.isFullScreen) {
this.volume(1);
} else {
this.volume(0);
}
};
myPlayer.addEvent("fullscreenchange", onFullScreen);
https://github.com/zencoder/video-js/blob/master/docs/api.md
I'm using jquery ui tabs and video.js. I want to stop the video when I go to another tab and reset it when I come back to second tab.
As of VideoJS v4.6 you can do the following to reset the player:
player.pause().currentTime(0).trigger('loadstart');
That loadstart is the key which shows the poster image and rebinds the first play event.
u can use this for show poster or show bigplay button
$( '.backlink' ).click( function() {
// Player (this) is initialized and ready.
var myPlayer = _V_("video9");
myPlayer.currentTime(0); // 2 minutes into the video
myPlayer.pause();
myPlayer.posterImage.el.style.display = 'block';
myPlayer.bigPlayButton.show();
});
It's even easier.
let player = Video(el);
player.on('ended', () => {
player.initChildren();
});
First you need a reference to the video player.
http://videojs.com/docs/api/
var myPlayer = _V_("myVideoID");
Then you can use the API to start/stop/reset the video.
Stop:
myPlayer.pause();
Reset:
myPlayer.currentTime(0);
I'm not sure how the jquery tabs are set up, but you might be able to do:
$('.my-tab-class').click(function(){
myPlayer.pause().currentTime(0);
});
player.reset();
Life is simple.
Get the id of the video.just append _html5_api with the id since videojs appends these letters and then you could use pause and make currentTime equal to 0.
var videoStop = document.getElementById(videoId+"_html5_api");
videoStop.pause();
videoStop.currentTime= 0;
The solution I found was using the videojs api, invoke the reset function followed by initChildren for reconstruct the player structure, i'm using vesion 5.10.7.
videojs('sublime_video', {}, function () {
var videoPlayer = this;
videoPlayer.width(screen.width / 2);
videoPlayer.height(720);
videoPlayer.on("ended", function(){
videoPlayer.reset().initChildren();
});
});
I was looking for a way to reintialize the VideoJS plugin then I found this :-
var player = videojs('my-player');
player.on('ended', function() {
this.dispose();
});
Just dispose off the video and init again.
Source:- https://docs.videojs.com/tutorial-player-workflows.html#dispose
Is there any way to hide the popup when a pie slice is moused-over in the Google Visualization API using Pie Charts? Thanks
To remove the tooltips you have to do it this way:
chart.draw(data, {tooltip: {trigger:'none'}});
You can also remove all interactivity if you don't want your graph to react to any user actions:
chart.draw(data, {enableInteractivity: false});
I would try to set trigger to 'none
chart.draw(data, {trigger:'none'});
There is no option to turn on/off the tooltip currently. But following could do the trick:
tooltip_iframe = window.frames[document.getElementById('your chart id').firstChild.name];
tooltip_dom = tooltip_iframe.document.getElementById('chart').firstChild.nextSibling.nextSibling;
tooltip_dom.style.display = 'none';
This one works for me
var options = {
tooltip: {trigger:'none'}
};
chart.draw(data, options);