Log in

View Full Version : use Quicktime player instead of Flash mp3 player



salman1karim
09-11-2011, 06:28 AM
This is my first post in Dynamics fourms. I want to use quicktime player instaed of flash mp3 player. its working fine with flash mp3 player but when i use quicktime it will not play mp3 files.

For flash mp3 i use this coding:

<object type="application/x-shockwave-flash" data="<?php echo $svr_urlscript; ?>/player.swf" id="audioplayer2" height="24" width="290">
<param name="movie" value="<?php echo $svr_urlscript; ?>/player.swf" />
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
</object>
<?PHP } ?>
<?PHP } else { ?>
<object type="application/x-shockwave-flash" data="<?php echo $svr_urlscript; ?>/player.swf" id="audioplayer1" height="24" width="290">
<param name="movie" value="<?php echo $svr_urlscript; ?>/player.swf">
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
<?PHP } ?>

For Quicktime player i use this coding but it showning only quicktime logo:


<object id="audioplayer2" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="20" width="290" >
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3"/>
<param name="scale" value="aspect" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<embed type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" height="20" width="290" src="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" scale="aspect" controller="true" autoplay="false" /></embed>
</object>
<?PHP } ?>
<?PHP } else { ?>
<object id="audioplayer1" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="20" width="290" >
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3"/>
<param name="scale" value="aspect" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<embed type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/" height="20" width="290" src="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3"
scale="aspect" controller="true" autoplay="false" /></embed>
</object>
<?PHP } ?>

This is website address for using quciktime: http://www.drnooriy.com/quranshop/index.php?page=detail&get_id=15&category=

jscheuer1
09-11-2011, 01:49 PM
Flash is the industry standard. It's virtually guaranteed to be installed. QT is not so universally available. However, Apple - the author of QT has elected not to support Flash in its new iWhatever products, at least for now. They may change that and a workaround and/or workarounds are already available for at least some, perhaps all of their new iStuff.

So, why you would even want to do this is beyond me. I might want to detect these iWhatever OS's and serve them QT. But I might also elect not to cater to Apple's iNonsense and let iWhatever users figure out a way to get the content, complain to Apple, or both.

So be aware that if you proceed with this, you will likely be losing audience overall (a large number of the vast majority of non iPhone/Pad users), albeit making it easier for iDiots to hear the audio.

A sensible approach would be the branching mentioned above so that all could hear it in the format best suited/allowed.

However, since you asked, the QT code in your post is a mishmash. There are no flashvars in QT. And you're not showing a movie.

Googling:

quicktime object tag mp3

I got this:


<object type="audio/x-mpeg" data="http://www.drnooriy.com/quranshop/product_images/sample_Surah%20Al-Jinn.mp3"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="290" height="20">
<param name="src" value="http://www.drnooriy.com/quranshop/product_images/sample_Surah Al-Jinn.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
<!--[if !IE]> <-->
<object type="audio/x-mpeg" data="http://www.drnooriy.com/quranshop/product_images/sample_Surah%20Al-Jinn.mp3" width="290" height="20">
<param name="src" value="http://www.drnooriy.com/quranshop/product_images/sample_Surah Al-Jinn.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
</object>
<!--> <![endif]-->
</object>

It's not standard according to the w3c, but does work for the various PC browsers, and presumably would for iPhone/Pad.

I suppose it would translate to, in your PHP code as:


<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body>
<object id="audioplayer1" type="audio/x-mpeg" data="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="290" height="20">
<param name="src" value="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
<!--[if !IE]> <-->
<object type="audio/x-mpeg" data="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" width="290" height="20">
<param name="src" value="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
</object>
<!--> <![endif]-->
</object>
<?PHP } ?>
<?PHP } else { ?>
<object id="audioplayer2" type="audio/x-mpeg" data="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3"
classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="290" height="20">
<param name="src" value="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
<!--[if !IE]> <-->
<object type="audio/x-mpeg" data="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" width="290" height="20">
<param name="src" value="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
</object>
<!--> <![endif]-->
</object>
</body>
</html>

djr33
09-11-2011, 10:02 PM
What John posted should help.

Quicktime isn't a bad option since it is widely supported, although on PCs it's not always installed these days [by users-- it's never preinstalled]. My impression as of a few years ago (5-10?) is that QT was more popular, but now it's being replaced by flash. It's still significantly better than any other media plugin (such as windows media player, real player, etc.) For videos I prefer QT to anything else, unless you want a low quality flash video. But I might be in the minority for that.

For audio, I'd go in another direction. If you're just looking to find a way to play compatible audio on your site, I'd suggest the following link:
http://www.schillmania.com/projects/soundmanager2/

salman1karim
09-12-2011, 12:27 PM
Thanks your kind reply. You know, this site is not only windows user can access some users are trying to access from iphone or ipad and i know after putting quick time a lot of user complained. But this is my client requirement :). Any How i didn't check your code i will be check and let you know. Again Thanks:)

jscheuer1
09-12-2011, 01:07 PM
Well, that's why I was thinking give Flash to those that can support it, QT for those who cannot. And Daniel's idea is worth looking into to see if it supports the iDevices.

salman1karim
09-12-2011, 01:34 PM
Its working! But very slow. Even some pages are not open :(. The quick time player is not display in mozilla firefox.

one more thing, I didn't use this part of code because after using its giving parse error:


<!--[if !IE]> <-->
<object type="audio/x-mpeg" data="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" width="290" height="20">
<param name="src" value="<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="controller" value="true" />
<param name="autoplay" value="false" />
<param name="autostart" value="0" />
<param name="pluginurl" value="http://www.apple.com/quicktime/download/" />
</object>
<!--> <![endif]-->

Is it possible i can use both player. e.g if user don't have quick time than flash player will be run?

jscheuer1
09-12-2011, 01:47 PM
What kind of a parse error, PHP, javascript, something else, what? And I would do it the other way around. Give Flash to those who support it and QT to the rest.

djr33
09-12-2011, 03:20 PM
The link I posted above will solve your problems. SoundManager2 is a script designed to make compatible audio. It does not use quicktime. It uses Flash and HTML5 <audio> embeds and potentially something else (Javascript audio?) and finds the solution that will work. If nothing works, it will give a direct link to the file so at least everyone can download it. It's by far the most compatible method for audio I have ever seen. Look at the site's information.

salman1karim
09-13-2011, 12:41 PM
What kind of a parse error, PHP, javascript, something else, what? And I would do it the other way around. Give Flash to those who support it and QT to the rest.

John Sorry lately i reply back. I edit some code and after testing now its only working in Mozilla Firefox. the sound is not working in Internet Explorer and Apple products.
In Internet explorer i receive error in index.php line No 113 but when i check inside the code of index.php there i define the style sheet of main website.
:confused:

@Daniel: Yes i test his code and its working. According your opinion i cant give link to the user to download the file and my client also don't need from this way. :(

jscheuer1
09-13-2011, 03:15 PM
We could probably troubleshoot the page if we had a link to it. But if Daniel's idea works, I'd say go with it.

salman1karim
09-14-2011, 12:08 PM
Ahh i got the solution :). i download source of php browser and from this code firstly i detect browser type and after that if user came from ipad, iphone or from safari than quick time player will worked but if user connect from internet explorer or Mozilla Firefox than flash player will worked. Thanks to john and daniel who helped me to figure out this issue

This is source code:


<object type="application/x-shockwave-flash" data="<?php echo $svr_urlscript; ?>/player.swf" id="audioplayer2" height="24" width="290">
<param name="movie" value="<?php echo $svr_urlscript; ?>/player.swf" />
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
</object>
<?PHP } ?>
<?PHP } else { ?>
<?php
require_once('dbrowser.php'); // assuming Browser.php is in the same path as this script
$browser = new Browser();
if( $browser->getBrowser() == Browser::BROWSER_IE || $browser->getBrowser() == Browser::BROWSER_FIREFOX|| $browser->getBrowser() == Browser::BROWSER_CHROME) {?>
<object type="application/x-shockwave-flash" data="<?php echo $svr_urlscript; ?>/player.swf" id="audioplayer1" height="24" width="290">
<param name="movie" value="<?php echo $svr_urlscript; ?>/player.swf">
<param name="FlashVars" value="playerID=audioplayer1&soundFile=<?php echo $svr_urlscript; ?>/product_images/sample_<?php echo $rowx[TITLE]; ?>.mp3">
<param name="quality" value="high">
<param name="menu" value="false">
<param name="wmode" value="transparent">
</object>
<?PHP } else {?>
<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="290"HEIGHT="24"
CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">
<PARAM name="SRC" VALUE="http://www.drnooriy.com/quranshop/quran_surah/test.mp3">
<PARAM name="AUTOPLAY" VALUE="true">
<PARAM name="CONTROLLER" VALUE="true">
<EMBED src="http://www.drnooriy.com/quranshop/quran_surah/test.mp3" WIDTH="290" HEIGHT="20"
AUTOPLAY="true" CONTROLLER="ture"
PLUGINSPAGE="http://www.apple.com/quicktime/download/">
</EMBED>
</OBJECT>
<?php }} ?>