Question

in my test to some video php script i got an error in there mobile version while i was searching the files i knowed the file needed to be edited the error is any uploaded flv video will not work in the mobile and it will show an error message, so i have add (flv) beside other formats now will show loading but the video will not work here is the code

        $ext = strtolower(array_pop(explode('.', $video['url_flv'])));
        if($ext == 'mov' || $ext == 'm4a'|| $ext == 'm4v' || $ext == 'mp4' || $ext == 'm2a' || $ext == 'm2v' || $ext == '3g2' || $ext == '3gp' || $ext == 'mp3') {
        if($ext == 'mp3' || $ext == 'm4a')
            $type = 'audio';
        else
            $type = 'video';
        $embed_code = 'Loading...</div>'; //Close this div as we will insert the player with javascript
        $embed_code.= '<div><script language="javascript">
        $(function(){
            var screenw = window.outerWidth;
            var screenh = screenw/16*9; //Common video format + 20px for controls

            tag = \'<'.$type.' id="playingvid" style="width:\' + screenw + \'px;'.(($type=='video')?'height:\' + screenh + \'px;':'').'" controls allowfullscreen>\'+

                \'  <source src="';
        if($video['source_id']==1 && substr($video['url_flv'],0,7) != 'http://'){
            $embed_code.=_URL.'/uploads/videos/'.$video['url_flv'];
        }else{
            $embed_code.=$video['url_flv'];
        }
        $embed_code.= '"></video>\';
            $("#video_player .videoWrapper").html(tag);
            $(window).resize(function() {
             var screenw = document.body.clientWidth;
             var screenh = screenw/16*9; //Common video format + 20px for controls
             $("#playingvid").width(screenw).height(screenh);
            });
        });
        </script>
        ';

        } else {
            $embed_code = $lang['suggest_msg5'];
Was it helpful?

Solution

FLV videos are not supported by most (any?) mobile devices. You'll need to convert it to something widely supported.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top