client/templates/nodeeditor_video.html
changeset 657 50f5e8d2c839
parent 654 b2789b4cd389
equal deleted inserted replaced
656:95e2c6d21b5f 657:50f5e8d2c839
    33         return match[2];
    33         return match[2];
    34     }
    34     }
    35     return false;
    35     return false;
    36 }
    36 }
    37 
    37 
       
    38 function get_facebook_id(url) {
       
    39     var regExp = /^https?:\/\/www\.facebook\.com\/(?:video\.php\?v=\d+|.*?\/videos\/\d+)\/?$/;
       
    40     
       
    41     var match = url.match(regExp);
       
    42 
       
    43     if (match) {
       
    44         return encodeURIComponent(url);
       
    45     }
       
    46     return false;
       
    47 }
       
    48 
    38 %>
    49 %>
    39 <h2>
    50 <h2>
    40     <span class="Rk-CloseX">&times;</span>
    51     <span class="Rk-CloseX">&times;</span>
    41     <% if (options.show_node_tooltip_color) { %>
    52     <% if (options.show_node_tooltip_color) { %>
    42         <span class="Rk-UserColor" style="background: <%-node.color%>;"></span>
    53         <span class="Rk-UserColor" style="background: <%-node.color%>;"></span>
    61     <%  }
    72     <%  }
    62     else if(video_id = get_dailymotion_id(node.uri)) { %>
    73     else if(video_id = get_dailymotion_id(node.uri)) { %>
    63         <iframe frameborder="0" width="255" height="143" src="https://www.dailymotion.com/embed/video/<%=video_id%>?autoPlay=0" allowfullscreen=""></iframe>
    74         <iframe frameborder="0" width="255" height="143" src="https://www.dailymotion.com/embed/video/<%=video_id%>?autoPlay=0" allowfullscreen=""></iframe>
    64         <p><a href="<%-node.uri%>" target="_blank"><%-renkan.translate("Link")%></a></p>
    75         <p><a href="<%-node.uri%>" target="_blank"><%-renkan.translate("Link")%></a></p>
    65     <%  }
    76     <%  }
       
    77     else if(video_id = get_facebook_id(node.uri)) { %>
       
    78         <iframe src="https://www.facebook.com/plugins/video.php?href=<%=video_id%>&width=255&show_text=false&height=143&appId" width="255" height="143" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true" allowFullScreen="true"></iframe>
       
    79         <p><a href="<%-node.uri%>" target="_blank"><%-renkan.translate("Video link")%></a></p>
       
    80     <%  }
    66     else { %> 
    81     else { %> 
    67         <video width="320" height="240" controls>
    82         <video width="320" height="240" controls>
    68             <source src="<%-node.uri%>" type="video/mp4">
    83             <source src="<%-node.uri%>" type="video/mp4">
    69         </video>
    84         </video>
    70     <%  }
    85     <%  }