⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 addbookmark.jsp

📁 HomePlayer is an extention of the FreePlayer software provided by the french internet provider Free
💻 JSP
字号:
<%@ page contentType="text/html;charset=ISO-8859-15" pageEncoding="ISO-8859-1"%>
<%@ page import="org.homeplayer.data.*" %>
<%@ page import="org.homeplayer.util.*" %>
<%@ page import="java.io.*" %>
<jsp:useBean id="hppc" class="org.homeplayer.web.HPPageContext" scope="request">
	<jsp:setProperty name="hppc" property="request" 		value="<%=request%>"/>
</jsp:useBean> 
<%
	//VLCControl vlc = VLCControl.shareInstance();
	VLCInfo vlcInfo = HPSession.get("PFPPLAYER", false)==false ? VLCControl.shareInstance().getInfo() : PFPControl.shareInstance().getInfo();
	MediaItem media = vlcInfo.getCurrentMedia();
	int time = vlcInfo.getCurrentPlayTime();
	if (media == null) {
		System.out.println("Impossible to add a bookmark : The currently played media can not be found");
	} else if (! ((media instanceof Music) || (media instanceof Film))) {
		System.out.println("Impossible to add a bookmark : The currently played media is not an audio file neither a video file");
	} else if (time == 0) {
		System.out.println("Impossible to add a bookmark : The current time location in the media file can not be found or is 0");
	} else {
		BookmarkManager bmManager = BookmarkManager.getInstance();
		File mediaFile = new File(media.getPath());
		Bookmarks bm = bmManager.getBookmarks(mediaFile);
		if (WebUtil.getParam(request, "type", "normal").equals("normal")) {
			bm.put(new Bookmarks.Item(time));
		} else {
			bm.put(new Bookmarks.Item(time, null, Bookmarks.Item.TYPE_STOP));
		}
		
		bmManager.setBookmarks(mediaFile, bm);
	}
	String next = WebUtil.getParam(request, "next", "/info.jsp");
	boolean confirmation = WebUtil.getParam(request, "conf", false);
    if (confirmation) {
    	hppc.setRefresh(0, "bookmarkAdded.jsp?next=" + WebUtil.urlEncode(next));
    } else {
    	hppc.setRefresh(0, next);
    }
%>

<%@page import="org.homeplayer.util.pifreeplayer.PFPControl"%><html>
    <head><jsp:include page="/WEB-INF/jsp/head.jsp" /></head>
    <body>
    </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -