sending information from scripting side to flash video player - php

I don't know how to ask this, but the thing is that i was thinking that how does youtube or videofy.me like video blogs send the video path & all info to a flash video player i mean when e click on any video link how does it sets up everything and displays the chosen video, because actually i've created one but in that i had to set up the whole page via flash so that it can manipulate the information like path & name of the video, and cannot use html links, php and all.. so can u people tell me how do i start up & how this process is done & what i need to do & other important things on this.. i mean sending any info to a flash player via any scripting or server side language. Thank you..

There are several ways:
you can "hijack" clicks on links via JavaScript and JavaScript can communicate with flash (e.g. via ExternalInterface)
or you can change/add hash to the current page and Flash can be listening to such changes - this is how you could implement also flash deep linking for example
another option would be use javascript to remove the old video element from the page, and inject a new video (flash) element with the correct flashVars so the chosen video will play ...

Related

Hide the source URL on HTML 5 audio player

Can I hide the source URL in the HTML 5 audio player? I am using audiojs api to make my web audio player now, but I don't know how to hide the source URL. Should I use other way to make the audio player, I can use PHP, jQuery and javascript to do that. This is my assignment, please help me.
You can't hide the source URL.
The source URL is required for the browser to be able to get to the audio data. The URL must be available in some form. Now, you can redirect to it, load it with JS, etc., but at the end of the day anyone can look in the network tab and see that URL.

trigger audio .wav using php

Need advice, guidance on triggering a .wav file to play when a web page loads content and a specific keyword is within body of that content.
The content is being pulled from a Yammer network thru a custom app I created to look for certain hashtag messages using PHP. Now, I'd like to have a sound play (like a bell) when a specific hashtag has a new message. The bell would not ring a second time, just on the intial display.
Suggestions (using PHP)?
To play music in your site, place, <embed src="yourfile.wav"></embed> anywhere in page and checkout.
You can make it dynamic by using php in src.

Crawl embeded Flash video and render Javascript to obtain final GUI

Now, I am encountering some difficulties when I have to scan or crawl a video URL link. This web page is using the Flash-based technology to embed the video and stream video.
In order to understand more clearly, this is a link example:
http://vnexpress.net/gl/the-gioi/tu-lieu/2012/11/bai-phat-bieu-thua-nhan-that-bai-cua-romney/
The above link has below content (HTML code for Flash embedded video):
<div id="flashContent" style="text-align:center;width:100%;">
<span id="FlashPlayer79237" class="Normal" align="center">Bạn cần cài Flash Player để xem được Clip này.</span>
</div>
In this above article, there is a above video. However, when I tried to scan or crawl the content, the video could not run properly (because it could not load correct video link) and only show Install Flash Player plugin words (Certainly, the real web page needs to run some Javascript script or Flash script to obtain the real video link and stream this video for users)
Therefore, how can I render Flash and Javascript script through PHP or ASP.NET or Java? How can I get the correct video link when I crawl the web page? In this case, how can I obtain the correct Flash embedded video (HTML code)?
Thank you so much.
Before I answer, I want to make a note that if you need this information to do anything shady... please don't.
Disclaimer aside, for that particular site it is relatively easy.
The flashvars param (which is probably put there by Javascript) contains a value called xmlPath, which is a url encoded path (relative to their domain name). If you grab that and decode it, you get something like:
/Service/FlashVideo/PlayListVideoPage.asp?id=79237&f=108&t=1
which points to
http://vnexpress.net/Service/FlashVideo/PlayListVideoPage.asp?id=79237&f=108&t=1
If you read that, it's an XML file which contains the URL of the actual video.
I'm not quite sure where that value is generated from. If you needed to do this fully server-side, you could use a headless browser to process it.

Capturing the image view count on click while using jquery fancybox

does anyone have an idea on how I could capture the image id when a user clicks the next / previous button in Fancybox? I like how Fancybox changes depending on the size of the image so I prefer to use this over some of the other galleries that I have seen. Has anyone successfully done this? The site is in PHP.
The general idea would be to "proxy" your images by a PHP script.
This script would:
add 1 to the view count of the image
serves the image to the browser (instead of serving an HTML page as usual)
You would then update the src attribute of your pictures img tag :
<img src="mypicture.png"/>
would become
<img src="view_picture.php?picture=1"/>
Note that you must be careful and not authorize a filename in the picture parameter and/or carrefully check that the user is not trying to see a file that you don't want to show him (think view_picture.php?picture=../.htpasswd )
Consider using a general website analytics software, like Piwik. This will give you additional insights on you visitors and their actions on your site, rather than a simple image view counter.
I am running a site that uses Fancybox and Piwik, all image views through Fancybox will automatically show up in the Downloads section of Piwik reports without any additional configuration.
But you could easily customize this through Fancybox's onComplete callback and Piwik's trackPageView(). See Piwik Javascript API and Fancybox API for details.

flash and jquery or html5 audio?

What is the best way to construct a audio player that can communicate with the jquery on my site?
Can I have flash send jquery commands when a song is finished playing?
Does html5 audio support a onSongEnd or similar function?
Songs on my site are a series of links that trigger jquery to reload a flash audio player with the appropriate song info. I would like to improve it so that I will automatically move on to the next song, or not depending on the users listening preferences. I would also like to be able to randomly play a promotional clip before playing the chosen song.
Do I need a custom flash player for this?
What is the best way to go about this?
Can I have flash send jquery commands when a song is finished playing?
Yes, you can; you can listen to the soundComplete event on the corresponding SoundChannel object and call the appropriate JavaScript (and hence jQuery) function from Flash using ExternalInterface.call().
You can find sample code for both classes in the examples section of their corresponding pages. The example for soundComplete demonstrates how to load and play the next song upon completing the currently played one - basically you load the next song from the soundComplete event handler of the current song.
I think Flash is still a safe bet. Take a look at jPlayer; it is a JQuery plugin for playing audio files. It has a beautiful with some useful items, user interface.

Categories