anshuwap / mollify

Automatically exported from code.google.com/p/mollify
0 stars 0 forks source link

Flowplayer and IOS #415

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello First let me say that I love Mollify. Its great. I have one issue that I 
can't figure out. I update flowplayer.viewer.php to allow me to stream on my 
ipad. This is what it looks like:

<?php
    class FlowPlayerViewer extends FullDocumentViewer {
       protected function getHtml($item, $full) {

    $resourceUrl = $this->getResourceUrl();

        $head        = '<script type="text/javascript" src="'.$resourceUrl.'head.min.js"></script>';                    

        $html        =
 '<a href="'.$this->getContentUrl($item).'" class="player" 

style="display:block;width:580px;height:380px;margin:10px auto" 
id="player"></a>'.

                       '<script>
                          head.js(

                              "http://releases.flowplayer.org/js/flowplayer-3.2.11.min.js",

                         function(){

                          head.js("http://releases.flowplayer.org/js/flowplayer.ipad-

3.2.10.min.js");

                          });

                          head.ready(function() {
                           $f("player", "http://releases.flowplayer.org/swf/flowplayer-

3.2.12.swf").ipad();

                          });
                        </script>';

return 

"<html>
    <head>
        <title>".$item->name()."
        </title>
        ".$head."
    </head>

    <body>
       ".$html."
    </body>
</html>";
        }
    }
?>

It works great in Chrome and IE. Problem is in IOS. The only way it works is if 
I replace <a href="'.$this->getContentUrl($item).'" with an absolute link such 
as <a href="http://localhost/movie.mp4" </a>. Your input would be great. 
thankyou.

Original issue reported on code.google.com by aospina1...@gmail.com on 21 Jul 2012 at 5:02

GoogleCodeExporter commented 9 years ago
The url used is already absolute, the difference is that your example url is 
not handled by Mollify. Instead, your url "http://localhost/movie.mp4" is 
served by the web server directly.

As a side note, storing the files like this (under web root) is not 
recommended, since you, nor Mollify, does not have any control what files are 
accessible, since anyone can get them by figuring out the "direct url". 
Recommended way is to move the Mollify published folders outside web root, 
where web server cannot access them, but Mollify can. Definitely not the reason 
for the problem here, just for the info.

But since it works with other browsers, combined with the fact that "direct 
url" works, I suspect this is a matter of HTTP headers and/or mime types. 
Mobile browsers are sometimes very picky about the headers, at least when it 
comes to downloading files. And same goes with mime types often, because unless 
the server tells correctly what is the stream about, in many cases the player 
will refuse to play it.

Mollify has mime type configuration, see 
http://code.google.com/p/mollify/wiki/BackendSettings#MIME_types_(_mime_types_)

The default mime type for mp4 is already set to 'video/mp4', so it should be 
correct. Unfortunately I don't have experience on this exact scenario, so I 
can't give you any solution.

Original comment by samuli.j...@gmail.com on 22 Jul 2012 at 12:10

GoogleCodeExporter commented 9 years ago
so after doing some research i found out what the issue is. The only problem is 
I have no idea how to implement the fix. appendix a of this article 
http://mobiforge.com/developing/story/content-delivery-mobile-devices explains 
how to fix it. Can anyone help?

Original comment by aospina1...@gmail.com on 1 Aug 2012 at 3:27

GoogleCodeExporter commented 9 years ago
The link points out few things necessary for mobile browsers:
- mime type (should be ok)
- HTTP headers (should be ok)
- range support (ie. partial download)

Mollify does support range download, but file viewer does not have this, did 
not occur to me that viewing would require this as well.

I uploaded a beta version, if you want to try it. I added filename to the 
viewer url, which could make some difference on some cases, and also range 
support for viewing. However, I don't have mobile viewer set up, so I could not 
test it.

You can find it here: 
http://code.google.com/p/mollify/downloads/detail?name=mollify_1.8.9.3b1.zip

Original comment by samuli.j...@gmail.com on 1 Aug 2012 at 10:28

GoogleCodeExporter commented 9 years ago
Thank you for your time but no luck I removed the use of the flowplayer plugin 
and just did a download and I still get the same problem. It looks like its 
going to play then i get the play button with a slash going throw it. Playback 
on IOS is all I need.

Original comment by aospina1...@gmail.com on 2 Aug 2012 at 3:40