HTML5 widget seekTo not working - html

I'm having trouble getting the seekTo method to work with the HTML5 widget API. Basing this on the API docs and examples.
I'm able to play my player with:
widget.play();
But:
widget.seekTo(10000);
Doesn't seem to do anything. I thought maybe I needed to seekTo, then play. But that didn't work either. Does anyone have a working example of seekTo in action that they could share?

Unfortunately its not Asynchronous, you have to first see when the player is ready. After its ready, you have to play the sound. After you play the sound, you seek to it.
var soundcloud=SC.Widget('soundcloudPlayer');
soundcloud.bind (SC.Widget.Events.READY,function(){
soundcloud.play();
});
soundcloud.bind (SC.Widget.Events.PLAY,function(){
soundcloud.seekTo(845700);
});

Related

setInterval with play() in flash as3?

I'm trying to play a sound (notification sound) in my flash application and I need to play the sound until the user clicks on something else to stop it.
I can play the sound properly but the issue is that it will only play once but i need it to play constantly (a short delay between each play maybe?).
my current code is this:
var mySound:Sound = new Sound();
mySound.load(new URLRequest("iphonenoti_cRjTITC7.mp3"));
mySound.play();
so I thought I can use setInterval(mySound,5000); in my code but this doesn't work which means it doesn't play the sound on the loop!
could someone please advise on this?
Thanks in advance.
Well, reading the Documentation of setInterval it states that the first parameter should be a function. In your code, you are passing an Object of the type Sound.
So, there are a couple of options, I'll show you the quickest and dirtiest one.
Instead of setInterval(mySound,5000); you write setInterval(mySound.play,5000);

vimeo timecode inaccurate using AS3 API

I am using Vimeo's Flash API so that I can embed and read the timecode of a video using the playProgressHandler, pause it at certain times, pop a menu, and use buttons that trigger seekTo calls. Although everything works, the timecode is inaccurate to varying degrees. Anywhere from 1-2 seconds. I can tell this because:
1) If I play my video on Vimeo and pause it at 6:03 and do the same with it embedded in Flash the visuals do not match up. Flash is lagging behind a tad.
2) I did a test using the JavaScript API. My seekTo calls were consistently accurate. To seek to the same spot using the AS3 API I had to add 1.5 seconds. But even this isn't foolproof. Sometimes it works, but sometimes it's still off.
Any ideas what would account for this inaccuracy and how I might fix this problem? Yes, I can ditch the AS3 and use the JS version, but I'd prefer to just fix what I've already built.
(I also posted this on Vimeo's forum, but I'm following their "Limited support in API Forum" post which suggests to post here)
Unfortunately, there's not much we can do to fix this other than to recommend that you use our iframe embed.
It has to do with the way that we retrieve files from our CDN. Because Flash doesn't support byterange requests, we pass a parameter that returns part of the file starting at that position. The nature of how that works means it's always going to be imprecise.

Controls for Youtube Chromeless Player In Flash

I'm tearing my hair out trying to add controls such as pause and volume to my Chromeless Youtube Player in Flash with actionscript 3, tried working with the reference that google provide but it still doesn't work. Here's what I tried, can anyone tell me where I'm going wrong?
function pauseVideo() {
if (player) {
player.pauseVideo();
}
}
pauseBtn.addEventListener(MouseEvent.CLICK,pauseVideo);
Thanks
How I understand you are trying to integrate youtube's player into your application. Take a look at this example it may help you and check with the documentation if you are loading correctly their player and it's fully loaded when you are trying to access it, first example
*I would like to help you more but I don't know how you instantiate the player

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.

Opening a URL from Flash using navigateToURL (AS3)

Been pulling my hair out for hours today over this.
I can't open another website from my already opened flash site.
Here is the code:
GotoFB.addEventListener(MouseEvent.CLICK, gotoFB);
function gotoFB(event:MouseEvent):void
{
navigateToURL(new URLRequest("http://www.facebook.com"), "_blank");
}
This works from the flash player but not from chrome/ie/firefox..
Had some problems with navigateToUrl in recent chrome-update in my Flex-app. Had to use this workaround:
ExternalInterface.call("window.open", url, target);
Some popup blockers blocks navigateToURL(..., "_blank"), there is a bunch of workarounds of varying quality out there, mainly involving calling JavaScript's window.open via ExternalInterface instead of using navigateToURL(..., "_blank"). If you google for it, you may find one that works in your case.
File->Publish Settings->Local playback security->Access network only
Voila...