Flex and Video Annotation - apache-flex

I have been investigating how to annotate video using Flex or AIR. Similar to how it is being done on YouTube. I am not getting much joy. Wondered if anybody might have any insight?
Thanks
--Matt

This could actually be simpler than you thought.
Here's what I would do:
Play the video
When you see a spot you want to add an annotation for click the annotation button or the video to stop it and add an annotation
When you click that button you grab the timecode from the video
Save the timecode and your annotation details in a database
The next time you play the video, you load the annotations and their timecodes from the database
Before the video start playing you add cuepoints to it using the CuePointManager class in Flex
Add an event listener to the video player that will listen for these cuepoints
When the cuepoint hits you can show your annotation at the correct time code etc
Hope this helps.
Serge-

Matt you can refer the Youtube AS3 API's at
http://code.google.com/apis/youtube/flash_api_reference.html
You can check some demo examples from the link above to get an understanding how you can start off. You can also do this with Javascript API's if you are interested.
We have used Youtube AS3 API for enriching videos for content companies and it was fairly straightforward to built it - check demo at onion.tv

Related

Youtube embed in wordpress

I am trying to embed an interval of a youtube video on my wordpress.
I have managed to set the start and final point that i want.
The problem is when the video ends, I want to make an option to restart the video but from the starting point I´ve set, not from the begining of the video.
Any idea how to achieve it?
I think the youtube embed start parameter is what you're looking for. Check out the youtube developers page. Hope that helps!
Or use iframe api and catch ending of video and programmicaly start play video again.

How to track how much of a youtube video the user has watched?

I need to track how much of an embedded youtube video the user has watched on my site. I need it to fire a tag at 25%, 50%, 75% and 100% of the length of the video. It should work similarly as a scrolling page track.
The only access I have to the site is through Googletag manager, so any solution would have to be through there.
I´ve researched and aparently there are ways to do this using youtube api. I even tried this step-by-step guide: http://www.cardinalpath.com/youtube-video-tracking-with-gtm-and-ua-a-step-by-step-guide/ But it didn´t work.
I guess the problem is that the site uses fancybox the play the video. Here is a pick of the website´s code:
I have no idea where to start.
Please take a look at
Track YouTube Video Playback with jQuery and Google Analytics Events
https://developers.google.com/youtube/js_api_reference
You need to track the current playback time, get the total playing time and then convert it to percentages.
Use the chromeless player and use the youtube js api. See the Playback_status method. I agree with putting a timer. However, there are methods and callbacks available at the js api that I highly recommended for you to use.
You will probably have to use
onStateChange event
getDuration()
getCurrentTime()
and you probably need those inside the onStateChange wrapper or something better.
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
}
function onytplayerStateChange(newState) {
alert(ytplayer.getDuration()+ytplayer.getCurrentTime());
}
At the player state change, you may fire your own methods inside.
It's not a working example, but I hope that you get my answer. The modal / popup boxes is not related in getting the data needed. You just need to use the chromeless player and the YT js api working in harmony with your jQuery plugins. There are some jQuery plugins that is an API wrapper for multiple video sharing technologies.
Bower and Google is your friend!
http://bower.io/search/?q=youtube
Another option worth looking into, if YouTube is not your only options, I'm pretty sure both Vimeo and Wistia have these capabilities built in and are very simple to embed
what you can do is when getting the you tube video request the length of the video. Then divide that number accordingly to 25%, 50%, 75% and 100%.
You can attempt this by setting a timer at the same time the video plays and then calling the tag at the different times which were calculated before hand.
Hope this helps!

How create a frame for our video?

I have a video which I want users to see in my webpage. I have uploaded that video on youtube also.
My current coding is
<iframe src="https://www.youtube.com/embed/ilbR0MiH6Ho"></iframe>
But this shows the video in the style(with same loaders, buttons, interface, etc..) it is being shown at youtube...
But I want it to be shown in other style like it is shown in some other sites like http://www.apple.com/your-verse/#video-your-verse It has a different style of viewing videos!!
That way, I also want to create my own frame to view my video(with a play button of my designing, my loading bar, my interface, etc..)
Can anyone out there help me with that?? Thanks in advance...
if you need your own 'player' or 'skin', you will have to use the available players like "JWPlayer" or "flowplayer" or create your own. Then you will have to host your videos elsewhere, where a streaming link has to be obtained.
Its not easy unless you have the technical skills required to create your own video player. But you can use the existing opensource players like I mentioned before.

How to add Facebook Like button to a Flex app?

I am working on a Flex AS3 application and wanted to add the Facebook Like button inside the app. I am unable to find any API or anything apart from the http://developers.facebook.com/docs/reference/plugins/like code generator.
Any ideas on how this might be accomplished? I am quite new to the recent changes in the Facebook Platform, so any info would be appreciated.
A direct "like" button should not be possible, since Facebook needs to sandbox the whole thing. Both like button formats (iframe and xfbml) use a sandboxed iframe, so nobody but facebook can set "likes" or know anything about the user.
For that to work with Flash, I think facebook would have to provide the button itself as a SWF file so you can load it in Flash. Then it can create a sandbox within itself and thus load the user information safely. Very much like the Chromeless Youtube Player, where it's almost impossible for Flash to access the actual FLV URL (even through introspection).
But even so, I don't think this would provide enough security... realize that you are dealing with very private user information and credentials here.
The only way I know you can "like" stuff through Flash is first doing the whole Facebook Connect thing (several popup windows asking the user for permissions) and then using the API of your choice to do the actual "liking", for instance, with the Graph API:
http://developers.facebook.com/docs/api#publishing
The closest information I could find are these 2 items so far. Hope it helps you in your journey.
Facebook Developer Site: Source
Facebook like button in flash
I hate answering "no" to a question because what I really mean is "I don't know and I can't find a way". I'm sure your Google-fu is as good as mine. All I can see are Facebook forum posts like this where people are asking the same question and no one is answering.
The examples they give of the like button are either embedded in iFrames or using XFBML <fb:like ../> tag. There are no examples of how to like something using their new graph api or either of their old APIs (FQL and REST API).
I had to get a Facebook like button in a html page (looked like a header on the top) and get the swf embedded below. As its a complete flex app in my case, this work around was possible and plausible

How do I login in with facebook connect in a flex application

I've been checking out facebook connect stuff from the new actionscript 3 library from Adobe. I have been trying to figure out how to use the facebook connect button inside of a flex app.
In an html page you would us the fbml and it would automatically put the facebook connect button on your page and when the user clicks on it it pops up the face div and lets the user login. Well you can't use that in flex. So I could put it on the page containing the swf but, that's why I'm using flex and not html. I've seen it done by the guys at Universal Mind so I know it's possible. I just need a little direction.
I know the function to use in the facebook connect api to cause that login dialog to come up I just can't figure the correct combination.
Chcek out the Create your first Facebook application with Flex tutorial and in particular the section on Add Facebook login.
This should be applicable to Flex. This would be done using the ExternalInterface calls from within Flash.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html
In Adobe facebook-actionscript-api there is a class LoginWindow which you can use.
When you need it this window will open like small flash popup window and it will display facebook login page and enable user to login. All needed events will be raised and you should be connected after that. I didn't tested it but from the code looks like what you need.
this developer created this js/flash bridge you are talking about using the ExternalInterface classes. you can download all source files as well. i found it very useful.
http://www.wellconsidered.be/blog/2009/01/04/facebook-connect-to-actionscript-3/
There is also a very clean and elegant solution/tutorial at:
http://www.stevenvh.be/blog/?p=57
Use this API:
http://code.google.com/p/facebook-actionscript-api/
Look at ConnectDemo.
The sample kind of sucks... it forces you to connect before showing the Flex app.
You need to tweek the example to get it to do what you want.
Also, FB depreciated some of the methods, so you have to look up new methods that aren't depreciated.
I'd love to update the sample, but I don't have the time to dedicated to another project.

Resources