View Full Version : سوال: مشکل با پخش ویدئو و mod_rewrite !!
woeful
یک شنبه 29 دی 1392, 21:06 عصر
سلام
من یه سایت روی local درست کردم که فایل های تصوریری با پسوند flv رو نمایش میده با استفاده از حالت عادی
یعنی فرضا با ادرس مشابه با آدرس زیر درست کار میکنه و هیچ مشکلی نیست :
http://127.0.0.1/showfile.php?hash=file_hash
ولی وقتی از حالت mod_rewrite استفاده می کنم مثلا با آدرس زیر :
http://127.0.0.1/s/file_hash
صفحه لود میشه اما همون قسمتی که مربوط به پخش فایل تصویری هست که با flash_player هم کار میکنه لود نمیشه و درست کار نمیکنه
از دوتا اسکریپت پخش ویدئو هم استفاده کردم هردوشون به همین مشکل خوردن
یکی اسکریپت mpw_player
یکی هم flowplayer
ممنون میشم کمک کنید.
woeful
دوشنبه 30 دی 1392, 15:18 عصر
up.................
woeful
سه شنبه 01 بهمن 1392, 15:48 عصر
خوشبختانه جواب پیدا کردم
با راهنمایی این دوست عزیز در سایت stackoverflow.com مشکل حل شد اینجا میزارم به درد بقیه بخوره :
I know its old question, but just in case someone will still search for an answer. I just witness same errors.
The deal is: with L parameter mod_rewrite will point request to the location you specified but all the ajax calls, includes, javascript src requests will behave as you where under original location.
Check the headers using LiveHeaders in Firefox for instance and you will see that your requests are pointing to wrong locations. I.e.: if in your play.php you link javascript like
src="myJS.js"
if RewriteRule points from
[siteroot]/play/some_data_here
to
[siteroot]/play.php?data=some_data_here
you will see that your play.php file will try to include src="play/myJS.js" which of course is not there so it returns 404 aka text/html.
In my case I 'fixed it' by adding R parameter so it redirects to new location. Down side of this is that address in the browser will change. Try changing [QSA,L] to [QSA,L,R].
Hope this helps.
وقتی از حالت mod_rewrite استفاده میشه تمام فایل های جاوا اسکریپت آدرسشون باید به طور کامل ذکر بشه برای مثلا من برای پخش فیلم ها از یه پلیر استفاده کردم که یه فایل جاوا اسکریپت داره که باید داخل head ذکر بشه
اگر ما در حالت mod_rewrite به عنوان مثال از آدرس زیر استفاده کنیم :
http://127.0.0.1/s/file_hash/
و تگ scrip داخل head هم به شکل زیر باشه :
<script src="swfobject.js" type="text/javascript"></script>
وقتی صحفه لود میشه فایل جاوا اسکریپتو توی این مسیر جستجو میکنه
http://127.0.0.1/s/file_hash/swfobject.js
که این اشتباهه و فایل جاوا اسکریپتو لود نمیکنه ( با اد ان Live Header فایرفاکس معلوم میشه ۴۰۴ میده )
باید آدرس کامل فایل جاوا رو توی src بذارید مثل :
<script src="http://127.0.0.1/script_path/swfobject.js" type="text/javascript"></script>
مشکل من اینطوری حل شد .
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.