如何用cookie记住字幕语言?

anhgbhbe  于 2021-06-23  发布在  Mysql
关注(0)|答案(0)|浏览(237)

我使用php和mysql来设置字幕,如果它们存在于数据库中的话。如果它们不存在,它就不会出现在播放器中。
我想有某种cookie,它可以记住访问者选择的语言,并在默认情况下为将来的视频启用标题。现在荷兰语字幕上有'default=“true”'(如果可能,请使用备份语言。)

<div class=" embed-responsive-16by9 player">
  <video id="video" class="video-js vjs-default-skin player-self" poster="<?php printf ("%s",$episode[thumbnail]); ?>"  controls preload="metadata">
    <source src="<?php printf ("%s",$episode[file]); ?>#track=fre&track=ger&track=jpn" type="video/mp4">
        <?php if(empty($episode['sub_eng'])){}else{?><track src="<?php printf ("%s",$episode['sub_eng']); ?>" kind="subtitles" srclang="en" label="English"><?php }?>
        <?php if(empty($episode['sub_eng_sign'])){}else{?><track src="<?php printf ("%s",$episode['sub_eng_sign']); ?>" kind="subtitles" srclang="en" label="English Signs and Songs"><?php }?>
        <?php if(empty($episode['sub_eng_sdh'])){}else{?><track src="<?php printf ("%s",$episode['sub_eng_sdh']); ?>" kind="subtitles" srclang="en" label="English SDH"><?php }?>
        <?php if(empty($episode['sub_dut'])){}else{?><track src="<?php printf ("%s",$episode['sub_dut']); ?>" kind="subtitles" srclang="nl" label="Dutch" default="true"><?php }?>
        <?php if(empty($episode['sub_dut_sign'])){}else{?><track src="<?php printf ("%s",$episode['sub_dut_sign']); ?>" kind="subtitles" srclang="nl" label="Dutch Signs and songs"><?php }?>
        <?php if(empty($episode['sub_fin'])){}else{?><track src="<?php printf ("%s",$episode['sub_fin']); ?>" kind="subtitles" srclang="fi" label="Finnish"><?php }?>
        <?php if(empty($episode['sub_fre'])){}else{?><track src="<?php printf ("%s",$episode['sub_fre']); ?>" kind="subtitles" srclang="fr" label="French"><?php }?>
        <?php if(empty($episode['sub_ger'])){}else{?><track src="<?php printf ("%s",$episode['sub_ger']); ?>" kind="subtitles" srclang="de" label="German"><?php }?>
        <?php if(empty($episode['sub_ita'])){}else{?><track src="<?php printf ("%s",$episode['sub_ita']); ?>" kind="subtitles" srclang="it" label="Itaian"><?php }?>
        <?php if(empty($episode['sub_nor'])){}else{?><track src="<?php printf ("%s",$episode['sub_nor']); ?>" kind="subtitles" srclang="it" label="Norwegian"><?php }?>
        <?php if(empty($episode['sub_por'])){}else{?><track src="<?php printf ("%s",$episode['sub_por']); ?>" kind="subtitles" srclang="it" label="Portuguese"><?php }?>
        <?php if(empty($episode['sub_spa'])){}else{?><track src="<?php printf ("%s",$episode['sub_spa']); ?>" kind="subtitles" srclang="es" label="Spanish"><?php }?>
        <?php if(empty($episode['sub_swe'])){}else{?><track src="<?php printf ("%s",$episode['sub_swe']); ?>" kind="subtitles" srclang="it" label="Swedish"><?php }?>
  </video>                                                            
  <script async crossorigin="anonymous" src="//player.h-cdn.com/loader.js?customer=hc_9b69e6d6"></script>                                          
  <script>                                                 
    window.hola_player({                                                
      player: '#video',                                                     
    });                                                               
  </script>                                                            
</div>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题