Controls for Youtube Chromeless Player In Flash - actionscript-3

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

Related

Seekbar for mp3 player in Actionscript 3.0 Flash CS-6

I'm trying to create a music player in Flash CS6. I'm new to Flash. I have created the play/pause/volume buttons. I have also been able to extract the mp3 information using the id3 tags. So i have the song duration. I now need to create a seekbar/progress bar. I have taken the progress bar from the components, but do not understand how to code it now. Please help!
According to the reference on Sound.play():
public function play(startTime:Number = 0, loops:int = 0, sndTransform:flash.media:SoundTransform = null):SoundChannel
where the first argument is
startTime:Number (default = 0)//The initial position in milliseconds at which playback should start.
so you can call
channel.stop();
channel = sound.play(offset);
There is an example in the reference. Hope this helps.
You can get some idea using my audio player on my Github page.Also it's developed using flash CS6 and ActionScript 3.0. Use it, change it and develop your future with ActionScript .

google doubleclick studio. video component

im bulding a flash banner where I'm using the components that double-click studio offers for free use in rich media banners.
Im the VideoPlayerAdvanced.
API documentatio here: http://www.google.com/doubleclick/studio/docs/sdk/flash/as3/en/com_google_ads_studio_video_VideoPlayerAdvanced.html
My question is how i dynamically can add a video player like the to the stage by addChild() or something like that. I also want to be able to set the urls for the player to play by code. That part seems quite straight forwards. But i can't figure out how to create an instance of the player dynamically by code.
Anyone that knows this?
Thanks!
Solved it by adding the component itself to a container movie clip and exported it with a classname for action script.
var video:Video = new Video();
addChild(video);
"video" holding the component.

PhotoFrame is displayed when youtube videos playing in WebBrowser

I have written code for playing youtube videos in webbrowser.
Xaml code:
<phone:WebBrowser x:Name="webBrowser" Height="411" IsScriptEnabled="True" Margin="10,100,78,0" />
Xaml.cs code:
Movie movie;
public VideoPage()
{
InitializeComponent();
var app = App.Current as App;
movie = app.selectedMovie;
string video =movie.MovieWatchLink;
this.webBrowser.Navigate(new Uri(video));
}
When I run this code at first white color PhotoFrame is displaying as shown in below figure.
And when we tap it.Movie starts playing in nativeplayer.And when we want to move back to movies list also this photoframe is displaying.
Please anybody help me how can I remove this.I searched my level best eventhough I didnt get any solution. Please help me how can I immediately play after selecting the movie.
ManyThanks in Advance
You can try collapsing the visibility of the webBrowser until the video starts streaming in the native player if we can get any handle of media being played in our code.or else you can try showing a thumbnail image related to the video until it starts to stream in player.
Showing thumbnail will be a better choice.
Regards,
Ganesan S

HTML5 widget seekTo not working

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);
});

Flash Auto Pause video after x seconds and play after selected option

I am doing project on developing a small game(A Soccer Penalty shootout guess game). I was hoping if someone could tell if it is possible to do the following function. I am using Adobe Flash Pro CC.
I am trying to pause the video that i have imported at 3.5 seconds and then two buttons appear with options either a Miss or Goal.. Once the user selects either option the video continues to play.
My question, is it possible to do this using Actionscript in Flash. if so what commands/function does it require.
Thanks
You could do it something like this (given that you are using the FLVPlayback component with the variable name of myFLVPlaybackComponent)
should be
myFLVPlaybackComponent.addEventListener(VideoEvent.PLAYHEAD_UPDATE, videoPause);
private function videoPause(evt:VideoEvent):void {
if (evt.playheadTime >= 3500){
myFLVPlaybackComponent.stop();
}
}
then call myFLVPlaybackComponent.play(); on your resume video function