Videojs ASS does not work on pages with Rewriterule

Asked

Viewed 29 times

0

I use RewriteRule (.*) /index.php [QSA,L] and to manage the Urls use this code:

<?php

$url = ltrim( parse_url( $_SERVER['REQUEST_URI'] , PHP_URL_PATH ) , '/' );
$url = explode( '/' , $url );

if(count($url) == 1)
{
if(file_exists(DIR_PAGES.$url[0].'.php'))
{
    if($url[0] == 'home')
    {
        $pag = DIR_PAGES.'home.php';
    }
    else
    {
        $pag = DIR_PAGES.$url[0].'.php';
    }
}
else if(file_exists(DIR_PAGES.$url[0]) && $url[0] != '')
{
    header('Location: '.SITE_URL.substr($url[0], 0, -4));
}
else if($url[0] == '' || $url[0] == null)
{
    $pag = DIR_PAGES.'home.php';
}
else
{
    header('Location: '.SITE_URL);
}
}
else if(count($url) == 2)
{
if($url[0] == 'stream' || $url[0] == 'newstream')
{
    if($url[1] != '' || $url[1] != null)
    {
        if($url[0] == 'stream')
        {
            $pag = DIR_PAGES.'stream.php';
        }
        else
        {
            $pag = DIR_PAGES.'newstream.php';
        }
    }
    else
    {
        header('Location: '.SITE_URL);
    }
}
else
{
    header('Location: '.SITE_URL);
}
}

I’m using, but when I access site.com/newstream/someone Videojs ASS to work.

    videojs('player', {
    controls: true,
    nativeControlsForTouch: false,
    fluid: true,
    plugins: {
      ass: {
        'src': ["./vjs/002.ass"],
        'delay': 0
      }
    },
    sources: [{"type": "video/mp4", "src": "/files/video.mkv"}]
    });
  • And this Videojs ASS requests some file from the server?

  • Do, from the caption file, tried with direct link site.com/files/arquivo.ass and with link from the root /var/www/site/files/arquivo.ass, but it didn’t work.

  • Why are you directing all Urls to the index.php. Try to add something like RewriteCond %{REQUEST_URI} !\.(?:ass)$ [NC] in his .htaccess and see if anything changes.

  • Still not solved, how can I solve this by changing my . htaccess, even if I have to change it completely, I just want when someone accesses site.com/stream/algumnome, I can get the value algumnome running the stream.php file

  • @Andersoncarloswoss Remembering that I define the src Videojs on the same page and works perfectly.

  • And how would that be? You can post the code?

  • Okay, I already put the code in the question.

  • And if you don’t define the src on the same page, as Videojs knows which file to search for?

  • I don’t understand what you want to know with your question, could explain better ??

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.