Remove Vimeo replay button - vimeo

First off I do apologies if this isn't the kind of question I should be asking on stackoverflow. I'm trying to remove the small 'replay' button in the bottom left of a Vimeo video after it's finished playing. Or at least just keep the controls visible (either or).
I've been through all the documentation related to player.js on Git and gone through the SDK doc's related to the API and I can't find anything related to the replay button / event. I can trigger items after the ended event. But this will not do anything within the player because it's contained in an iframe. Any pointing in the right direction here will be of great help. I've also google searched and it's drawing a blank.
Thanks

I found the answer for this one just incase someone searches for the same thing. The simple solution was to destroy the player on ending.
player.on('ended', function () {
player.destroy();
player = new Vimeo.Player('video', options);
});
Hope this may help someone else out.

Related

Flash Movies and ActionScript - Stop the video from working offline

I posted a question on superuser which seems to have a code related answer, so here it goes. I have a problem; I need to share videos online, but need to find a way to either completely stop, or at least make it hard for people to download them and view them online. I'm aware that if it was possible, Hollywood would have done it already, but I have an idea...
Some years ago I stumbled across a video on newgrounds.com, a site for flash animators to post their content for users to rate, feedback and comment on, a place where I spent hours downloading videos to play them at school (oh the irony...), but I remember one video was diferent. After downloading, and opening the .swf file, it stoped playback and displayed a frame that said "Sorry, this animation was made to be viewed on newgrounds.com. You can find it there anytime!". I was mad at the time, but now it gave me an idea...
Is there some way I can get the animation to check the current location/directory of the file being played, so that if it finds out it's being played from a physical computer instead of the server it was meant to be played from, it stops playback completely???
You can get the URL that the SWF is playing on (generally the page's location, if embedded in HTML) through stage.loaderInfo.url, I believe. So you can just check that against the URL of your site.
This can be fooled, though. I could set up a vhost on my machine that could probably mimic your site's address in the loaderInfo which would allow me to play it. You'd be better off using a form of DRM than this. DRM is, in general, much more difficult to crack than faking a URL.
This functionality is called "Site locking". You can google that term for more information. Here is a link to the AS3 Games Blog "Emenuelle Ferronato" with a tutorial on how to sitelock a file.
http://www.emanueleferonato.com/2008/03/10/how-to-sitelock-a-flash-movie/
The blog gives the code in AS2, so I updated it below using AS3. This code needs to have access to the stage, and you need to call "sitelock(urls_allowed)" at the point the lock check should be perforemed.
urls_allowed = ["www.emanueleferonato.com", "www.triqui.com"];
sitelock(urls_allowed);
function sitelock(urls_allowed) {
lock = true;
domain_parts = stage.loaderInfo.url.split("://");
real_domain = domain_parts[1].split("/");
domain.text = real_domain[0];
for (x in urls_allowed) {
if (urls_allowed[x] == real_domain[0]) {
lock = false;
}
}
if (lock) {
stage.alpha = 0;// make sure this function has access to the stage.
}
}

Button that only works once in flash actionscript 3.0

I have this collecting item game which u have to collect enough "stars" in order to acess a button. After I clicked the "star" button, it suppose to disappear and never appear again. However, when using this script, although the button disappear once I clicked it, when I returned to the frame after going to another frame, it appeared again! pls help!
star1.addEventListener(MouseEvent.CLICK,gotstar);
function gotstar(event:MouseEvent){
stars++;
star1.x = -500;
}
Are you coding on the frames themselves? If so every time you enter a frame it will run every piece of contained code, even if it has already ran once. A solution to this would be to use a document class to track the progress of the game.
you need to remove it from the stage if I understand.
try this instead of star1.x = -500;
stage.removeChild(star1);
star1.removeEventListener(MouseEvent.CLICK,gotstar);
star1.parent.removeChild(star1); in the click handler code (gotstar) should help
however posting your .fla file might be useful for better understanding

ActionScript 3 scrolling issues

I'm trying to make a google maps style interface for a design project. I've got the drag/drop and zoom functions working, but I also want to make it react to gestures on a trackpad (macbook). I assumed 'listening' to the event.delta of a MouseEvent would do the trick, but somehow it's not working. So what's wrong with my code?
stage.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelEvent);
function onMouseWheelEvent(event:MouseEvent):void {
tafelOrigineel_mc.y += event.delta;
}
I have loaded the flash MouseEvents earlier in the document, so that shouldn't be the problem. After I got this working, I will try to use it on the x-axis too. Is that possible with the MOUSE_WHEEL eventlistener?
Thx in advance
It is a long time problem regarding flash player on MacOS.
MOUSE_WHEEL event won't dispatch on MacOS. Though there are some workarounds involving the use of JavaScript to detect the use of the wheel (over the entire flash content), if it isn't a issue, try checking one of those.
There is a list in this blog post:
http://www.impossibilities.com/v4/2009/03/06/flash-mousewheel-implementations-for-mac-os-x/

HTML5 video - playing only a portion of a video

Is there some straightforward technique to play only a certain part of a HTML5 video? For example in a 30 second clip I would like to play only the part 5-20 sec. Additionally the rest of the video should not be accessible from the UI at all (meaning the video timeline should only show the 5-20 sec part).
I've been going through some HTML5 video players but none of them seem to be supporting this kind of functionality. If anyone knows a (good) way to implement this feature please give me a hint.
Thanks in advance!
Even though this question has already been marked as answered, here's something that may interest you and anyone else who stumbles across here: Specifying playback range.
It's part of the Media Fragment API and currently works in the latest versions of Firefox, Chrome and Safari 6+.
You can implement it there is a Player.Play() event in a players, whenever Play() called start a timer and call the Player.stop() on the specific time you want.
I got the same problem and I didn't found something that can solves this problem, what you can do is to implement your own controls and display the video with a canvas...
and if you are trying to implement this in IOS you will not be able to do it.
My thought would be to use custom controls, as I don't believe that functionality is available natively. All the functionality of html5 controls (play, pause, start at timestamp, etc.) can be called via javascript. In this case you are going to want to edit the currentTime variable.
So you may want to consider setting up your own slider, where the start of the slider represents your starting point, and the end your ending point. Set the video to not play on page load. Then on page load have a javascript function change the currentTime to your starting point. For stopping you could occasionally query the currentTime. I wouldn't use a timer as delays like slow loading could throw it off.
I am trying to implement a similar video in "Preview Mode". I am utilizing the methods stated above by adding an event listener and then pausing the video at a currentTime()=='x' postition. To prevent user from simply hitting play again, the currentTime listener wont allow playback past the 'x' time in the timeline so each time the user hits play, it is automatically instantly paused again. Furthermore, at time 'x' the video container will become hidden through CSS thus preventing interaction from the user with the video.

Open info window if user hovers longer than x milliseconds

What I'm trying to do is very simple:
open the marker's info window only if the user has hovered on the marker for longer than x millisecond.
I can't find how to do this anywhere. I would appreciate a little code snippet to show me how to set this up!
The jQuery HoverIntent plugin might be able to help you
http://cherne.net/brian/resources/jquery.hoverIntent.html
hoverIntent is a plug-in that attempts to determine the user's intent... like a crystal ball, only with mouse movement! It works like (and was derived from) jQuery's built-in hover. However, instead of immediately calling the onMouseOver function, it waits until the user's mouse slows down enough before making the call.
Actually I finally found the solution to it on the Google Maps Group here: http://groups.google.com/group/google-maps-api/browse_thread/thread/73cf193d42a0bbfe/fa531a39b353d198?lnk=gst&q=open+hover#fa531a39b353d198
Best of luck to all the late night coders out there :)